Skip to content

Commit

Permalink
Merge pull request #329 from spuder/spuder/lsbdist
Browse files Browse the repository at this point in the history
Adds check to params.pp if lab-release is not installed
  • Loading branch information
Morgan Haskel committed Jul 29, 2014
2 parents 3a2fe3b + 64b8eb1 commit 256a63b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
}
}
}
'': {
fail('Unable to determine lsbdistid, is lsb-release installed?')
}
default: {
fail("Unsupported lsbdistid (${::lsbdistid})")
}
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/params_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,16 @@
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

0 comments on commit 256a63b

Please sign in to comment.