Skip to content

Commit 23c2227

Browse files
author
Joshua Hoblitt
committed
remove usage of $::lsbmajdistrelease fact
Instead use $::operatingsystemmajrelease as this fact is not dependant on redhat-lsb being present on the system.
1 parent 95c5d0f commit 23c2227

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

manifests/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class ipmi::params {
1414
case $::osfamily {
1515
'redhat': {
16-
case $::lsbmajdistrelease {
16+
case $::operatingsystemmajrelease {
1717
5: {
1818
# el5.x
1919
$ipmi_package = ['OpenIPMI', 'OpenIPMI-tools']
@@ -23,7 +23,7 @@
2323
$ipmi_package = ['OpenIPMI', 'ipmitool']
2424
}
2525
default: {
26-
fail("Module ${module_name} is not supported on lsbmajdistrelease ${::lsbmajdistrelease}")
26+
fail("Module ${module_name} is not supported on operatingsystemmajrelease ${::operatingsystemmajrelease}")
2727
}
2828
}
2929
}

spec/classes/ipmi_install_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
end
1414

1515
describe 'el5.x' do
16-
before { facts[:lsbmajdistrelease] = '5' }
16+
before { facts[:operatingsystemmajrelease] = '5' }
1717

1818
it { should include_class('ipmi::install') }
1919
it { should contain_package('OpenIPMI').with_ensure('present') }
2020
it { should contain_package('OpenIPMI-tools').with_ensure('present') }
2121
end
2222

2323
describe 'el6.x' do
24-
before { facts[:lsbmajdistrelease] = '6' }
24+
before { facts[:operatingsystemmajrelease] = '6' }
2525

2626
it { should include_class('ipmi::install') }
2727
it { should contain_package('OpenIPMI').with_ensure('present') }

spec/classes/ipmi_params_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
let(:facts) {{ :osfamily => 'RedHat' }}
66

77
describe 'el5.x' do
8-
before { facts[:lsbmajdistrelease] = '5' }
8+
before { facts[:operatingsystemmajrelease] = '5' }
99

1010
it { should include_class('ipmi::params') }
1111
end
1212

1313
describe 'el6.x' do
14-
before { facts[:lsbmajdistrelease] = '6' }
14+
before { facts[:operatingsystemmajrelease] = '6' }
1515

1616
it { should include_class('ipmi::params') }
1717
end
1818

19-
describe 'unsupported lsbmajdistrelease' do
20-
before { facts[:lsbmajdistrelease] = '7' }
19+
describe 'unsupported operatingsystemmajrelease' do
20+
before { facts[:operatingsystemmajrelease] = '7' }
2121

2222
it 'should fail' do
2323
expect { should include_class('ipmi::params') }.
24-
to raise_error(Puppet::Error, /not supported on lsbmajdistrelease 7/)
24+
to raise_error(Puppet::Error, /not supported on operatingsystemmajrelease 7/)
2525
end
2626
end
2727
end

spec/classes/ipmi_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
let :facts do
77
{
88
:osfamily => 'RedHat',
9-
:lsbmajdistrelease => '6',
9+
:operatingsystemmajrelease => '6',
1010
}
1111
end
1212

0 commit comments

Comments
 (0)