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:
Gonéri Le Bouder 2014-02-10 10:49:21 +01:00
parent 4a3cd372fd
commit 3e08dcf087
4 changed files with 16 additions and 16 deletions

View File

@ -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"

View File

@ -20,6 +20,10 @@
class cloud {
if ! ($::osfamily in [ 'RedHat', 'Debian' ]) {
fail("module puppet-horizon doesn't support ${::osfamily}")
}
# motd
file
{

View 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

View File

@ -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