Add an option variable to gnocchi-upgrade command

When running with Ceph as Gnocchi storage backend, the upgrade may fail
in certain situations, so we need to be able to insert some option into
the call.

Change-Id: I52be4a184be2b0cca2289acce86d8fdf3b807651
This commit is contained in:
Jens Rosenboom 2017-02-17 15:29:04 +01:00
parent e5a08068c8
commit 3b8259871e
3 changed files with 8 additions and 3 deletions

View File

@ -60,6 +60,7 @@ default['openstack']['telemetry']['identity-api']['auth']['version'] =
node['openstack']['api']['auth']['version'] node['openstack']['api']['auth']['version']
default['openstack']['telemetry-metric']['identity-api']['auth']['version'] = default['openstack']['telemetry-metric']['identity-api']['auth']['version'] =
node['openstack']['api']['auth']['version'] node['openstack']['api']['auth']['version']
default['openstack']['telemetry-metric']['gnocchi-upgrade-options'] = ''
%w(telemetry telemetry-metric).each do |ts| %w(telemetry telemetry-metric).each do |ts|
# specify whether to enable SSL for ceilometer API endpoint # specify whether to enable SSL for ceilometer API endpoint

View File

@ -93,7 +93,8 @@ if node['openstack']['telemetry-metric']['conf']['storage']['driver'] == 'file'
end end
# dbsync for gnocchi # dbsync for gnocchi
execute 'gnocchi-upgrade' do execute 'run gnocchi-upgrade' do
command "gnocchi-upgrade #{node['openstack']['telemetry-metric']['gnocchi-upgrade-options']}"
user node['openstack']['telemetry-metric']['user'] user node['openstack']['telemetry-metric']['user']
end end

View File

@ -111,8 +111,11 @@ describe 'openstack-telemetry::gnocchi_configure' do
end end
it do it do
expect(chef_run).to run_execute('gnocchi-upgrade') expect(chef_run).to run_execute('run gnocchi-upgrade')
.with(user: 'gnocchi') .with(
command: 'gnocchi-upgrade ',
user: 'gnocchi'
)
end end
it do it do