Browse Source

Make skip gnocchi option overridable

Since gnocchi is the default backend, We might want to be able to
override this option and let it skip by default for compatibility.
let user set it via extra_params.

Change-Id: I23e43552e14ced5a7da5e16ef323df3b1ec6722d
changes/27/424127/9
Pradeep Kilambi 5 years ago
parent
commit
96040df940
  1. 6
      manifests/db/sync.pp
  2. 2
      manifests/params.pp
  3. 5
      releasenotes/notes/replace-dbsync-command-74f9157fe81ddc4c.yaml
  4. 10
      spec/acceptance/ceilometer_wsgi_apache_spec.rb
  5. 14
      spec/classes/ceilometer_db_sync_spec.rb

6
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,

2
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'

5
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.

10
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': }

14
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

Loading…
Cancel
Save