Adds check to params.pp if lab-release is not installed
Adds spec test If lab-release is not installed, then the end user sees a confusing/ vague message Error: Unsupported lsbdistid () at /modules/apt/manifests/params.pp:52 It is common for docker containers to not include this package by default After fix, the user sees a friendlier message if lab-release is not installed Error: Unable to determine lsbdistid, is lsb-release installed? at /modules/apt/manifests/params.pp:52
This commit is contained in:
parent
06b5dc232b
commit
64b8eb1e4a
2 changed files with 15 additions and 0 deletions
|
@ -49,6 +49,9 @@ class apt::params {
|
|||
}
|
||||
}
|
||||
}
|
||||
'': {
|
||||
fail('Unable to determine lsbdistid, is lsb-release installed?')
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported lsbdistid (${::lsbdistid})")
|
||||
}
|
||||
|
|
|
@ -24,4 +24,16 @@ describe 'apt::params', :type => :class do
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
describe "With lsb-release not installed" do
|
||||
let(:facts) { { :lsbdistid => '' } }
|
||||
let (:title) { 'my_package' }
|
||||
|
||||
it do
|
||||
expect {
|
||||
should compile
|
||||
}.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue