dashboard: more puppetish syntax

This commit is contained in:
Gonéri Le Bouder 2014-02-08 00:31:13 +01:00
parent 1bef33f8da
commit 4a3cd372fd
2 changed files with 13 additions and 2 deletions

View File

@ -70,8 +70,7 @@ class cloud::dashboard(
$debug = $os_params::debug
) {
$supported = [ 'RedHat', 'Debian' ]
if grep($supported, $::osfamily) != [$::osfamily] {
if ! ($::osfamily in [ 'RedHat', 'Debian' ]) {
fail("module puppet-horizon doesn't support ${::osfamily}")
}

View File

@ -71,4 +71,16 @@ describe 'cloud::dashboard' do
it_configures 'openstack dashboard'
end
context 'on other platforms' do
let :facts do
{ :osfamily => 'Solaris',
:operatingsystemrelease => '10',
:concat_basedir => '/var/lib/puppet/concat' }
end
it 'should fail' do
expect { subject }.to raise_error(/module puppet-horizon doesn't support/)
end
end
end