diff --git a/manifests/params.pp b/manifests/params.pp index 5c93f166..3c9bb527 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,6 +1,7 @@ # == Class: swift::params # class swift::params { + include ::openstacklib::defaults case $::osfamily { 'Debian': { $package_name = 'swift' diff --git a/spec/classes/swift_bench_spec.rb b/spec/classes/swift_bench_spec.rb index 9fd52922..413aa632 100644 --- a/spec/classes/swift_bench_spec.rb +++ b/spec/classes/swift_bench_spec.rb @@ -26,8 +26,10 @@ describe 'swift::bench' do end let :facts do - { :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' } + OSDefaults.get_facts({ + :operatingsystem => 'Ubuntu', + :osfamily => 'Debian' + }) end let :params do diff --git a/spec/classes/swift_client_spec.rb b/spec/classes/swift_client_spec.rb index 3e681a6c..be8a4602 100644 --- a/spec/classes/swift_client_spec.rb +++ b/spec/classes/swift_client_spec.rb @@ -29,7 +29,7 @@ describe 'swift::client' do context 'on Debian platform' do let :facts do - { :osfamily => 'Debian' } + OSDefaults.get_facts({ :osfamily => 'Debian' }) end it_configures 'swift client' @@ -37,7 +37,7 @@ describe 'swift::client' do context 'on RedHat platform' do let :facts do - { :osfamily => 'RedHat' } + OSDefaults.get_facts({ :osfamily => 'RedHat' }) end it_configures 'swift client' diff --git a/spec/classes/swift_dispersion_spec.rb b/spec/classes/swift_dispersion_spec.rb index 587156bf..c037ea3e 100644 --- a/spec/classes/swift_dispersion_spec.rb +++ b/spec/classes/swift_dispersion_spec.rb @@ -21,7 +21,7 @@ describe 'swift::dispersion' do end let :facts do - { :osfamily => 'Debian' } + OSDefaults.get_facts({ :osfamily => 'Debian' }) end let :params do diff --git a/spec/classes/swift_objectexpirer_spec.rb b/spec/classes/swift_objectexpirer_spec.rb index 9840382e..fefa9a39 100644 --- a/spec/classes/swift_objectexpirer_spec.rb +++ b/spec/classes/swift_objectexpirer_spec.rb @@ -62,8 +62,10 @@ describe 'swift::objectexpirer' do context 'on Debian platforms' do let :facts do - { :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' } + OSDefaults.get_facts({ + :operatingsystem => 'Ubuntu', + :osfamily => 'Debian', + }) end let :platform_params do @@ -101,8 +103,10 @@ describe 'swift::objectexpirer' do context 'on RedHat platforms' do let :facts do - { :osfamily => 'RedHat', - :operatingsystem => 'RedHat' } + OSDefaults.get_facts({ + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + }) end let :platform_params do diff --git a/spec/classes/swift_proxy_ceilometer_spec.rb b/spec/classes/swift_proxy_ceilometer_spec.rb index c9d0622f..ea365561 100644 --- a/spec/classes/swift_proxy_ceilometer_spec.rb +++ b/spec/classes/swift_proxy_ceilometer_spec.rb @@ -3,9 +3,7 @@ require 'spec_helper' describe 'swift::proxy::ceilometer' do let :facts do - { - :osfamily => 'Debian' - } + OSDefaults.get_facts({ :osfamily => 'Debian' }) end let :pre_condition do diff --git a/spec/classes/swift_proxy_spec.rb b/spec/classes/swift_proxy_spec.rb index f50b7112..05285aae 100644 --- a/spec/classes/swift_proxy_spec.rb +++ b/spec/classes/swift_proxy_spec.rb @@ -10,10 +10,11 @@ describe 'swift::proxy' do # set os so memcache will not fail let :facts do - {:operatingsystem => 'Ubuntu', + OSDefaults.get_facts({ + :operatingsystem => 'Ubuntu', :osfamily => 'Debian', - :processorcount => 1 - } + :processorcount => 1, + }) end describe 'with proper dependencies' do @@ -322,9 +323,11 @@ node_timeout = 20 context 'on Debian platforms' do let :facts do - { :operatingsystem => 'Ubuntu', + OSDefaults.get_facts({ + :operatingsystem => 'Ubuntu', :osfamily => 'Debian', - :concat_basedir => '/var/lib/puppet/concat' } + :concat_basedir => '/var/lib/puppet/concat', + }) end let :platform_params do @@ -350,9 +353,11 @@ node_timeout = 20 context 'on RedHat platforms' do let :facts do - { :osfamily => 'RedHat', + OSDefaults.get_facts({ + :osfamily => 'RedHat', :operatingsystem => 'RedHat', - :concat_basedir => '/var/lib/puppet/concat' } + :concat_basedir => '/var/lib/puppet/concat', + }) end let :platform_params do diff --git a/spec/classes/swift_proxy_swift3_spec.rb b/spec/classes/swift_proxy_swift3_spec.rb index 0fffe005..b58b96d2 100644 --- a/spec/classes/swift_proxy_swift3_spec.rb +++ b/spec/classes/swift_proxy_swift3_spec.rb @@ -3,8 +3,10 @@ require 'spec_helper' describe 'swift::proxy::swift3' do let :facts do - { :osfamily => 'Debian', - :operatingsystem => 'Ubuntu' } + OSDefaults.get_facts({ + :osfamily => 'Debian', + :operatingsystem => 'Ubuntu', + }) end let :pre_condition do diff --git a/spec/classes/swift_ringbuilder_spec.rb b/spec/classes/swift_ringbuilder_spec.rb index b11f24f4..f10cf26c 100644 --- a/spec/classes/swift_ringbuilder_spec.rb +++ b/spec/classes/swift_ringbuilder_spec.rb @@ -2,11 +2,11 @@ require 'spec_helper' describe 'swift::ringbuilder' do let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', :osfamily => 'Debian', - :processorcount => 1 - } + :processorcount => 1, + }) end describe 'when swift class is not included' do it 'should fail' do diff --git a/spec/classes/swift_ringserver_spec.rb b/spec/classes/swift_ringserver_spec.rb index aada5ddf..b552d1c2 100644 --- a/spec/classes/swift_ringserver_spec.rb +++ b/spec/classes/swift_ringserver_spec.rb @@ -13,10 +13,10 @@ describe 'swift::ringserver' do end let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' - } + :osfamily => 'Debian', + }) end let :params do @@ -51,10 +51,10 @@ describe 'swift::ringserver' do end let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' - } + :osfamily => 'Debian', + }) end diff --git a/spec/classes/swift_spec.rb b/spec/classes/swift_spec.rb index 4c007b86..470e0e8a 100644 --- a/spec/classes/swift_spec.rb +++ b/spec/classes/swift_spec.rb @@ -10,10 +10,10 @@ describe 'swift' do end let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' - } + :osfamily => 'Debian', + }) end describe 'when no swift hash is specified' do diff --git a/spec/classes/swift_storage_account_spec.rb b/spec/classes/swift_storage_account_spec.rb index 4a7e55f3..acfe5a50 100644 --- a/spec/classes/swift_storage_account_spec.rb +++ b/spec/classes/swift_storage_account_spec.rb @@ -69,9 +69,10 @@ describe 'swift::storage::account' do context 'on Debian platforms' do let :facts do - {:operatingsystem => 'Ubuntu', - :osfamily => 'Debian' } - + OSDefaults.get_facts({ + :operatingsystem => 'Ubuntu', + :osfamily => 'Debian', + }) end let :platform_params do @@ -109,8 +110,10 @@ describe 'swift::storage::account' do context 'on RedHat platforms' do let :facts do - { :osfamily => 'RedHat', - :operatingsystem => 'RedHat' } + OSDefaults.get_facts({ + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + }) end let :platform_params do diff --git a/spec/classes/swift_storage_all_spec.rb b/spec/classes/swift_storage_all_spec.rb index d0892d24..3e63e5a6 100644 --- a/spec/classes/swift_storage_all_spec.rb +++ b/spec/classes/swift_storage_all_spec.rb @@ -3,10 +3,10 @@ require 'spec_helper' describe 'swift::storage::all' do let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' - } + :osfamily => 'Debian', + }) end let :pre_condition do @@ -125,10 +125,10 @@ describe 'swift::storage::all' do describe "when installed on Debian" do let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Debian', - :osfamily => 'Debian' - } + :osfamily => 'Debian', + }) end [{ :storage_local_net_ip => '127.0.0.1' }, diff --git a/spec/classes/swift_storage_container_spec.rb b/spec/classes/swift_storage_container_spec.rb index 23b15e47..9d6840a4 100644 --- a/spec/classes/swift_storage_container_spec.rb +++ b/spec/classes/swift_storage_container_spec.rb @@ -69,9 +69,10 @@ describe 'swift::storage::container' do context 'on Debian platforms' do let :facts do - {:operatingsystem => 'Ubuntu', - :osfamily => 'Debian' } - + OSDefaults.get_facts({ + :osfamily => 'Debian', + :operatingsystem => 'Ubuntu', + }) end let :platform_params do @@ -111,8 +112,10 @@ describe 'swift::storage::container' do context 'on RedHat platforms' do let :facts do - { :osfamily => 'RedHat', - :operatingsystem => 'RedHat' } + OSDefaults.get_facts({ + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + }) end let :platform_params do diff --git a/spec/classes/swift_storage_object_spec.rb b/spec/classes/swift_storage_object_spec.rb index 1a0e0c00..506a76e9 100644 --- a/spec/classes/swift_storage_object_spec.rb +++ b/spec/classes/swift_storage_object_spec.rb @@ -70,9 +70,10 @@ describe 'swift::storage::object' do context 'on Debian platforms' do let :facts do - {:operatingsystem => 'Ubuntu', - :osfamily => 'Debian' } - + OSDefaults.get_facts({ + :operatingsystem => 'Ubuntu', + :osfamily => 'Debian', + }) end let :platform_params do @@ -112,8 +113,10 @@ describe 'swift::storage::object' do context 'on RedHat platforms' do let :facts do - { :osfamily => 'RedHat', - :operatingsystem => 'RedHat' } + OSDefaults.get_facts({ + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + }) end let :platform_params do diff --git a/spec/classes/swift_storage_spec.rb b/spec/classes/swift_storage_spec.rb index e80f44cd..de50fef2 100644 --- a/spec/classes/swift_storage_spec.rb +++ b/spec/classes/swift_storage_spec.rb @@ -2,10 +2,10 @@ require 'spec_helper' describe 'swift::storage' do let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' - } + :osfamily => 'Debian', + }) end describe 'when required classes are specified' do diff --git a/spec/defines/swift_storage_generic_spec.rb b/spec/defines/swift_storage_generic_spec.rb index 291a13f7..379c79e8 100644 --- a/spec/defines/swift_storage_generic_spec.rb +++ b/spec/defines/swift_storage_generic_spec.rb @@ -7,10 +7,10 @@ describe 'swift::storage::generic' do end let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' - } + :osfamily => 'Debian', + }) end let :pre_condition do @@ -100,8 +100,10 @@ describe 'swift::storage::generic' do context 'on Debian platforms' do let :facts do - { :operatingsystem => 'Ubuntu', - :osfamily => 'Debian' } + OSDefaults.get_facts({ + :operatingsystem => 'Ubuntu', + :osfamily => 'Debian', + }) end let :platform_params do @@ -145,8 +147,10 @@ describe 'swift::storage::generic' do context 'on Redhat platforms' do let :facts do - { :operatingsystem => 'Redhat', - :osfamily => 'Redhat' } + OSDefaults.get_facts({ + :operatingsystem => 'Redhat', + :osfamily => 'Redhat', + }) end let :platform_params do diff --git a/spec/defines/swift_storage_node_spec.rb b/spec/defines/swift_storage_node_spec.rb index f75268f6..7d9b0bfa 100644 --- a/spec/defines/swift_storage_node_spec.rb +++ b/spec/defines/swift_storage_node_spec.rb @@ -1,11 +1,11 @@ describe 'swift::storage::node' do let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', :osfamily => 'Debian', - :processorcount => 1 - } + :processorcount => 1, + }) end let :params do diff --git a/spec/defines/swift_storage_server_spec.rb b/spec/defines/swift_storage_server_spec.rb index 00d0f445..f018cf5d 100644 --- a/spec/defines/swift_storage_server_spec.rb +++ b/spec/defines/swift_storage_server_spec.rb @@ -2,12 +2,11 @@ require 'spec_helper' describe 'swift::storage::server' do let :facts do - { + OSDefaults.get_facts({ :operatingsystem => 'Ubuntu', :osfamily => 'Debian', - :processorcount => 1 - } - + :processorcount => 1, + }) end let :pre_condition do