diff --git a/manifests/params.pp b/manifests/params.pp index 2a91a217..5bdb7bb5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -43,7 +43,7 @@ class cinder::params { case $::operatingsystem { 'RedHat', 'CentOS', 'Scientific': { - if $::operatingsystemmajrelease >= 7 { + if (versioncmp($::operatingsystemmajrelease, '7') >= 0) { $iscsi_helper = 'lioadm' } else { $iscsi_helper = 'tgtadm' diff --git a/spec/classes/cinder_volume_iscsi_spec.rb b/spec/classes/cinder_volume_iscsi_spec.rb index 90dff1e8..f2a75839 100644 --- a/spec/classes/cinder_volume_iscsi_spec.rb +++ b/spec/classes/cinder_volume_iscsi_spec.rb @@ -43,7 +43,7 @@ describe 'cinder::volume::iscsi' do it_raises 'a Puppet::Error', /Unsupported iscsi helper: fooboozoo/ end - describe 'with RedHat' do + describe 'on RHEL Platforms' do let :params do req_params @@ -52,6 +52,7 @@ describe 'cinder::volume::iscsi' do let :facts do {:osfamily => 'RedHat', :operatingsystem => 'RedHat', + :operatingsystemrelease => 6.5, :operatingsystemmajrelease => '6'} end @@ -66,12 +67,15 @@ describe 'cinder::volume::iscsi' do let :params do { :iscsi_ip_address => '127.0.0.2', - :iscsi_helper => 'lioadm' + :iscsi_helper => 'lioadm' } end let :facts do - {:osfamily => 'RedHat'} + {:osfamily => 'RedHat', + :operatingsystem => 'RedHat', + :operatingsystemrelease => 7.0, + :operatingsystemmajrelease => '7'} end it { is_expected.to contain_package('targetcli').with_ensure('present')}