diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index e33e404d..db08f6df 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -7,16 +7,16 @@ # [*extra_params*] # (Optional) String of extra command line parameters # to append to the ceilometer-upgrade command. -# Defaults to undef. +# Defaults to '--skip-gnocchi-resource-types'. # class ceilometer::db::sync( - $extra_params = undef, + $extra_params = '--skip-gnocchi-resource-types', ) { include ::ceilometer::deps include ::ceilometer::params - exec { 'ceilometer-dbsync': + exec { 'ceilometer-upgrade': command => "${::ceilometer::params::dbsync_command} ${extra_params}", path => '/usr/bin', user => $::ceilometer::params::user, diff --git a/manifests/params.pp b/manifests/params.pp index 340f573b..84b0df9b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,7 +6,7 @@ class ceilometer::params { include ::openstacklib::defaults - $dbsync_command = 'ceilometer-upgrade --config-file=/etc/ceilometer/ceilometer.conf --skip-gnocchi-resource-types' + $dbsync_command = 'ceilometer-upgrade' $expirer_command = 'ceilometer-expirer' $user = 'ceilometer' $event_pipeline = '/etc/ceilometer/event_pipeline.yaml' diff --git a/releasenotes/notes/replace-dbsync-command-74f9157fe81ddc4c.yaml b/releasenotes/notes/replace-dbsync-command-74f9157fe81ddc4c.yaml new file mode 100644 index 00000000..3608799e --- /dev/null +++ b/releasenotes/notes/replace-dbsync-command-74f9157fe81ddc4c.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Replace ceilometer dbsync with upgrade command. + dbsync has been deprecated. Also remove the + skip gnocchi opts as gnocchi is default now. diff --git a/spec/acceptance/ceilometer_wsgi_apache_spec.rb b/spec/acceptance/ceilometer_wsgi_apache_spec.rb index baae5ef3..9a508da9 100644 --- a/spec/acceptance/ceilometer_wsgi_apache_spec.rb +++ b/spec/acceptance/ceilometer_wsgi_apache_spec.rb @@ -14,7 +14,7 @@ describe 'ceilometer with mysql' do # TODO(aschultz): remove after fix for LP#1621384 hits RDO include ::gnocchi::client - Package['python-gnocchiclient'] -> Exec[ceilometer-dbsync] + Package['python-gnocchiclient'] -> Exec[ceilometer-upgrade] rabbitmq_user { 'ceilometer': admin => true, @@ -36,14 +36,18 @@ describe 'ceilometer with mysql' do telemetry_secret => 'secrete', default_transport_url => 'rabbit://ceilometer:an_even_bigger_secret@127.0.0.1:5672', } + class { '::ceilometer::keystone::auth': + password => 'a_big_secret', + } class { '::ceilometer::db::mysql': password => 'a_big_secret', } class { '::ceilometer::db': database_connection => 'mysql+pymysql://ceilometer:a_big_secret@127.0.0.1/ceilometer?charset=utf8', + sync_db => false, } - class { '::ceilometer::keystone::auth': - password => 'a_big_secret', + class { '::ceilometer::db::sync': + extra_params => '--skip-gnocchi-resource-types', } class { '::ceilometer::client': } class { '::ceilometer::collector': } diff --git a/spec/classes/ceilometer_db_sync_spec.rb b/spec/classes/ceilometer_db_sync_spec.rb index 1dfeb496..f57e132f 100644 --- a/spec/classes/ceilometer_db_sync_spec.rb +++ b/spec/classes/ceilometer_db_sync_spec.rb @@ -2,11 +2,11 @@ require 'spec_helper' describe 'ceilometer::db::sync' do - shared_examples_for 'ceilometer-dbsync' do + shared_examples_for 'ceilometer-upgrade' do - it 'runs ceilometer-dbsync' do - is_expected.to contain_exec('ceilometer-dbsync').with( - :command => 'ceilometer-upgrade --config-file=/etc/ceilometer/ceilometer.conf --skip-gnocchi-resource-types ', + it 'runs ceilometer-upgrade' do + is_expected.to contain_exec('ceilometer-upgrade').with( + :command => 'ceilometer-upgrade --skip-gnocchi-resource-types', :path => '/usr/bin', :refreshonly => 'true', :user => 'ceilometer', @@ -27,8 +27,8 @@ describe 'ceilometer::db::sync' do } end - it { is_expected.to contain_exec('ceilometer-dbsync').with( - :command => 'ceilometer-upgrade --config-file=/etc/ceilometer/ceilometer.conf --skip-gnocchi-resource-types --config-file=/etc/ceilometer/ceilometer_01.conf', + it { is_expected.to contain_exec('ceilometer-upgrade').with( + :command => 'ceilometer-upgrade --config-file=/etc/ceilometer/ceilometer_01.conf', :path => '/usr/bin', :user => 'ceilometer', :refreshonly => 'true', @@ -55,7 +55,7 @@ describe 'ceilometer::db::sync' do })) end - it_behaves_like 'ceilometer-dbsync' + it_behaves_like 'ceilometer-upgrade' end end