move the osfamily test in init.pp
As discussed with Emilien Macchi, this makes more sense since the whole module only support Debian and RedHat so far.
This commit is contained in:
parent
4a3cd372fd
commit
3e08dcf087
@ -70,10 +70,6 @@ class cloud::dashboard(
|
||||
$debug = $os_params::debug
|
||||
) {
|
||||
|
||||
if ! ($::osfamily in [ 'RedHat', 'Debian' ]) {
|
||||
fail("module puppet-horizon doesn't support ${::osfamily}")
|
||||
}
|
||||
|
||||
# We build the param needed for horizon class
|
||||
$keystone_url = "${keystone_proto}://${keystone_host}:${keystone_port}/v2.0"
|
||||
|
||||
|
@ -20,6 +20,10 @@
|
||||
|
||||
class cloud {
|
||||
|
||||
if ! ($::osfamily in [ 'RedHat', 'Debian' ]) {
|
||||
fail("module puppet-horizon doesn't support ${::osfamily}")
|
||||
}
|
||||
|
||||
# motd
|
||||
file
|
||||
{
|
||||
|
@ -71,16 +71,4 @@ 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
|
||||
|
@ -78,4 +78,16 @@ describe 'cloud' do
|
||||
# it_configures 'private cloud node'
|
||||
end
|
||||
|
||||
context 'on other platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Solaris' }
|
||||
end
|
||||
|
||||
it 'should fail' do
|
||||
expect { subject }.to raise_error(/module puppet-horizon doesn't support/)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user