Skip to content

Commit aa41e68

Browse files
committed
fix: add proxmox 6.1+ compatibility
1 parent 17ddda3 commit aa41e68

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

Gemfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
source 'https://rubygems.org'
44

5-
gemspec
6-
7-
gem 'fog-proxmox', '~> 0.9'
5+
gemspec

app/models/foreman_fog_proxmox/proxmox_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def version_suitable?
2525
logger.debug(format(_('Proxmox compute resource version is %<version>s'), version: version))
2626
raise ::Foreman::Exception, format(_('Proxmox version %<version>s is not semver suitable'), version: version) unless ForemanFogProxmox::Semver.semver?(version)
2727

28-
ForemanFogProxmox::Semver.to_semver(version) >= ForemanFogProxmox::Semver.to_semver('5.3.0') && ForemanFogProxmox::Semver.to_semver(version) < ForemanFogProxmox::Semver.to_semver('6.1.0')
28+
ForemanFogProxmox::Semver.to_semver(version) >= ForemanFogProxmox::Semver.to_semver('5.3.0')
2929
end
3030

3131
def version

lib/foreman_fog_proxmox/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.
1919

2020
module ForemanFogProxmox
21-
VERSION = '0.9.1'
21+
VERSION = '0.9.2'
2222
end

test/unit/foreman_fog_proxmox/proxmox_version_test.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class ProxmoxVersionTest < ActiveSupport::TestCase
2929
wrong_version = { version: '5.a', release: '1' }.with_indifferent_access
3030
supported_version = { version: '5.4', release: '3' }.with_indifferent_access
3131
supported_6_version = { version: '6.0', release: '1' }.with_indifferent_access
32-
unsupported_version = { version: '6.2', release: '2' }.with_indifferent_access
32+
supported_6_1_version = { version: '6.1', release: '3' }.with_indifferent_access
33+
unsupported_version = { version: '5.2', release: '2' }.with_indifferent_access
3334

3435
describe 'version' do
3536
before do
@@ -48,9 +49,9 @@ class ProxmoxVersionTest < ActiveSupport::TestCase
4849
assert_equal '5.4.3', @cr.version
4950
end
5051

51-
it 'returns 6.2.2 with 6.2-2' do
52+
it 'returns 5.2.2 with 5.2-2' do
5253
@identity_client.stubs(:read_version).returns(unsupported_version)
53-
assert_equal '6.2.2', @cr.version
54+
assert_equal '5.2.2', @cr.version
5455
end
5556
end
5657

@@ -79,7 +80,12 @@ class ProxmoxVersionTest < ActiveSupport::TestCase
7980
assert_equal true, @cr.version_suitable?
8081
end
8182

82-
it 'is false with 6.2-2' do
83+
it 'is true with 6.1-3' do
84+
@identity_client.stubs(:read_version).returns(supported_6_1_version)
85+
assert_equal true, @cr.version_suitable?
86+
end
87+
88+
it 'is false with 5.2-2' do
8389
@identity_client.stubs(:read_version).returns(unsupported_version)
8490
assert_equal false, @cr.version_suitable?
8591
end

0 commit comments

Comments
 (0)