diff --git a/manifests/processor.pp b/manifests/processor.pp index 586c636..49948b5 100644 --- a/manifests/processor.pp +++ b/manifests/processor.pp @@ -18,7 +18,7 @@ # # [*collector*] # (Optional) Data collector. -# Defaults to 'ceilometer'. +# Defaults to 'gnocchi'. # # [*window*] # (Optional) Number of samples to collect per call. @@ -48,7 +48,7 @@ class cloudkitty::processor ( $package_ensure = 'present', $manage_service = true, $enabled = true, - $collector = 'ceilometer', + $collector = 'gnocchi', $window = $::os_service_default, $period = $::os_service_default, $wait_periods = $::os_service_default, @@ -90,30 +90,15 @@ class cloudkitty::processor ( 'collect/services': value => $services; } - if $collector == 'ceilometer' { - cloudkitty_config{ - 'ceilometer_collector/auth_type': value => $auth_type; - 'ceilometer_collector/auth_section': value => $auth_section - } - cloudkitty_config { - 'gnocchi_collector/auth_type': ensure => absent; - 'gnocchi_collector/auth_section': ensure => absent; - } - $collector_real = $collector - } else{ - warning('Valid values of the collector option are ceilometer and gnocchi') - cloudkitty_config{ - 'gnocchi_collector/auth_type': value => $auth_type; - 'gnocchi_collector/auth_section': value => $auth_section; - } - cloudkitty_config { - 'ceilometer_collector/auth_type': ensure => absent; - 'ceilometer_collector/auth_section': ensure => absent; - } - $collector_real = 'gnocchi' + if $collector != 'gnocchi' { + warning('Valid value of the collector option is gnocchi') + $collector = 'gnocchi' } cloudkitty_config { - 'collect/collector': value => $collector_real; + 'collect/collector': value => $collector; + 'gnocchi_collector/auth_type': value => $auth_type; + 'gnocchi_collector/auth_section': value => $auth_section } + } diff --git a/releasenotes/notes/change_default_value_collector-19a896a02ad1f0c1.yaml b/releasenotes/notes/change_default_value_collector-19a896a02ad1f0c1.yaml new file mode 100644 index 0000000..378e8bd --- /dev/null +++ b/releasenotes/notes/change_default_value_collector-19a896a02ad1f0c1.yaml @@ -0,0 +1,5 @@ +--- +other: + - Change default value from 'ceilometer' to 'gnocchi' for collector option in + ::cloudkitty::processer class. Because the ceilometer collector has been + removed in cloudkitty repo. diff --git a/spec/classes/cloudkitty_processor_spec.rb b/spec/classes/cloudkitty_processor_spec.rb index a0d3a69..b5a5fac 100644 --- a/spec/classes/cloudkitty_processor_spec.rb +++ b/spec/classes/cloudkitty_processor_spec.rb @@ -5,7 +5,7 @@ describe 'cloudkitty::processor' do let :params do { :enabled => true, :manage_service => true, - :collector => 'ceilometer', + :collector => 'gnocchi', :period => '60', :wait_periods => '1', :window => '3600',} @@ -21,10 +21,8 @@ describe 'cloudkitty::processor' do it { is_expected.to contain_cloudkitty_config('collect/window').with_value( params[:window] ) } it { is_expected.to contain_cloudkitty_config('collect/period').with_value( params[:period] ) } it { is_expected.to contain_cloudkitty_config('collect/wait_periods').with_value( params[:wait_periods] ) } - it { is_expected.to contain_cloudkitty_config('ceilometer_collector/auth_type').with_value('password') } - it { is_expected.to contain_cloudkitty_config('ceilometer_collector/auth_section').with_value('keystone_authtoken') } - it { is_expected.to contain_cloudkitty_config('gnocchi_collector/auth_type').with_ensure('absent') } - it { is_expected.to contain_cloudkitty_config('gnocchi_collector/auth_section').with_ensure('absent') } + it { is_expected.to contain_cloudkitty_config('gnocchi_collector/auth_type').with_value('password') } + it { is_expected.to contain_cloudkitty_config('gnocchi_collector/auth_section').with_value('keystone_authtoken') } it 'installs cloudkitty-processor package' do is_expected.to contain_package('cloudkitty-processor').with( @@ -47,20 +45,6 @@ describe 'cloudkitty::processor' do end - context 'with gnocchi backend' do - before do - params.merge!({ - :collector => 'gnocchi', - }) - end - - it { is_expected.to contain_cloudkitty_config('collect/collector').with_value( params[:collector] ) } - it { is_expected.to contain_cloudkitty_config('gnocchi_collector/auth_type').with_value('password') } - it { is_expected.to contain_cloudkitty_config('gnocchi_collector/auth_section').with_value('keystone_authtoken') } - it { is_expected.to contain_cloudkitty_config('ceilometer_collector/auth_type').with_ensure('absent') } - it { is_expected.to contain_cloudkitty_config('ceilometer_collector/auth_section').with_ensure('absent') } - end - context 'when disabled' do let :params do { :enabled => false }