diff --git a/manifests/params.pp b/manifests/params.pp index 21f207a..68742e6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -241,7 +241,7 @@ class mysql::params { } default: { - fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat, Debian, and FreeBSD, or operatingsystem Amazon") + fail("Unsupported platform: puppetlabs-${module_name} currently doesn't support ${::osfamily} or ${::operatingsystem}") } } } @@ -303,4 +303,8 @@ class mysql::params { }, } + ## Additional graceful failures + if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '4' { + fail("Unsupported platform: puppetlabs-${module_name} only supports RedHat 5.0 and beyond") + } } diff --git a/spec/classes/graceful_failures_spec.rb b/spec/classes/graceful_failures_spec.rb index ff74ad0..d8f22b7 100644 --- a/spec/classes/graceful_failures_spec.rb +++ b/spec/classes/graceful_failures_spec.rb @@ -7,8 +7,7 @@ describe 'mysql::server' do let(:facts) { facts } context 'should gracefully fail' do - it { should_not contain_class('mysql::server') } - it { should raise_error(/Unsupported osfamily: foo/) } + it { expect { should compile}.to raise_error(Puppet::Error, /Unsupported platform:/) } end end end diff --git a/spec/classes/mysql_bindings_spec.rb b/spec/classes/mysql_bindings_spec.rb index fc2a5a9..0ee2e89 100644 --- a/spec/classes/mysql_bindings_spec.rb +++ b/spec/classes/mysql_bindings_spec.rb @@ -67,7 +67,7 @@ describe 'mysql::bindings' do end it 'should fail' do - expect { subject }.to raise_error(/Unsupported osfamily: foo/) + expect { subject }.to raise_error(/Unsupported platform:/) end end