From 3b8259871e5a731bd05fa0beeb4e64949666721b Mon Sep 17 00:00:00 2001 From: Jens Rosenboom Date: Fri, 17 Feb 2017 15:29:04 +0100 Subject: [PATCH] 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 --- attributes/default.rb | 1 + recipes/gnocchi_configure.rb | 3 ++- spec/gnocchi_configure_spec.rb | 7 +++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 63a26a1..c061680 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -60,6 +60,7 @@ default['openstack']['telemetry']['identity-api']['auth']['version'] = node['openstack']['api']['auth']['version'] default['openstack']['telemetry-metric']['identity-api']['auth']['version'] = node['openstack']['api']['auth']['version'] +default['openstack']['telemetry-metric']['gnocchi-upgrade-options'] = '' %w(telemetry telemetry-metric).each do |ts| # specify whether to enable SSL for ceilometer API endpoint diff --git a/recipes/gnocchi_configure.rb b/recipes/gnocchi_configure.rb index cb7b70b..0089589 100644 --- a/recipes/gnocchi_configure.rb +++ b/recipes/gnocchi_configure.rb @@ -93,7 +93,8 @@ if node['openstack']['telemetry-metric']['conf']['storage']['driver'] == 'file' end # 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'] end diff --git a/spec/gnocchi_configure_spec.rb b/spec/gnocchi_configure_spec.rb index f944f9c..277e844 100644 --- a/spec/gnocchi_configure_spec.rb +++ b/spec/gnocchi_configure_spec.rb @@ -111,8 +111,11 @@ describe 'openstack-telemetry::gnocchi_configure' do end it do - expect(chef_run).to run_execute('gnocchi-upgrade') - .with(user: 'gnocchi') + expect(chef_run).to run_execute('run gnocchi-upgrade') + .with( + command: 'gnocchi-upgrade ', + user: 'gnocchi' + ) end it do