Fix the backend for data collection

Change-Id: I1632007e472fccd54d9cfb78f5ee04ab5a31f612
This commit is contained in:
ZhongShengping 2016-12-05 10:37:08 +08:00
parent 207558fc33
commit 1374778768
2 changed files with 22 additions and 0 deletions

View File

@ -81,4 +81,15 @@ class cloudkitty::processor (
'collect/services': value => $services;
}
if !is_service_default($collector) and !empty($collector){
warning('Valid values of the collector option are ceilometer and gnocchi')
cloudkitty_config{
'gnocchi_collector/auth_section': value => 'keystone_authtoken';
}
} else{
cloudkitty_config {
'gnocchi_collector/auth_section': ensure => absent;
}
}
}

View File

@ -43,6 +43,17 @@ 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_section').with_value('keystone_authtoken') }
end
context 'when disabled' do
let :params do
{ :enabled => false }