From 16a35f2fc6fdcaf039f7c483449b9b9230324659 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 10 Jan 2023 13:44:02 +0900 Subject: [PATCH] Replace outdated command to create rally db The rally-manage db command was already replaced by the rally db command[1]. This fixes the outdated command still used. [1] https://review.opendev.org/c/openstack/rally/+/681224 Closes-Bug: #2002372 Change-Id: I34570e7c4131c3f06a1da23e9f2e57eec75ff25a --- manifests/db/sync.pp | 8 ++--- spec/classes/rally_db_sync_spec.rb | 55 +++++++++++++++--------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index aeabee4..e115428 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -5,8 +5,8 @@ # # [*extra_params*] # (Optional) String of extra command line parameters to append -# to the rally-manage db sync command. These will be inserted -# in the command line between 'rally-manage' and 'db create'. +# to the rally db sync command. These will be inserted in the command line +# between 'rally' and 'db create'. # Defaults to '--config-file /etc/rally/rally.conf' # # [*db_sync_timeout*] @@ -20,8 +20,8 @@ class rally::db::sync( include rally::deps - exec { 'rally-manage db_sync': - command => "rally-manage ${extra_params} db create", + exec { 'rally db_sync': + command => "rally ${extra_params} db create", path => '/usr/bin', user => 'root', refreshonly => true, diff --git a/spec/classes/rally_db_sync_spec.rb b/spec/classes/rally_db_sync_spec.rb index c49729a..e873dc1 100644 --- a/spec/classes/rally_db_sync_spec.rb +++ b/spec/classes/rally_db_sync_spec.rb @@ -6,9 +6,9 @@ describe 'rally::db::sync' do it { is_expected.to contain_class('rally::deps') } - it 'runs rally-manage db_sync' do - is_expected.to contain_exec('rally-manage db_sync').with( - :command => 'rally-manage --config-file /etc/rally/rally.conf db create', + it 'runs rally db_sync' do + is_expected.to contain_exec('rally db_sync').with( + :command => 'rally --config-file /etc/rally/rally.conf db create', :user => 'root', :path => '/usr/bin', :refreshonly => 'true', @@ -24,33 +24,32 @@ describe 'rally::db::sync' do ) end - describe "overriding params" do - let :params do - { - :extra_params => '--config-file /var/lib/rally/rally.conf', - :db_sync_timeout => 750, + context "overriding params" do + let :params do + { + :extra_params => '--config-file /var/lib/rally/rally.conf', + :db_sync_timeout => 750, + } + end + + it { + is_expected.to contain_exec('rally db_sync').with( + :command => 'rally --config-file /var/lib/rally/rally.conf db create', + :user => 'root', + :path => '/usr/bin', + :refreshonly => 'true', + :try_sleep => 5, + :tries => 10, + :timeout => 750, + :logoutput => 'on_failure', + :subscribe => ['Anchor[rally::install::end]', + 'Anchor[rally::config::end]', + 'Anchor[rally::dbsync::begin]'], + :notify => 'Anchor[rally::dbsync::end]', + :tag => 'openstack-db', + ) } end - - it { - is_expected.to contain_exec('rally-manage db_sync').with( - :command => 'rally-manage --config-file /var/lib/rally/rally.conf db create', - :user => 'root', - :path => '/usr/bin', - :refreshonly => 'true', - :try_sleep => 5, - :tries => 10, - :timeout => 750, - :logoutput => 'on_failure', - :subscribe => ['Anchor[rally::install::end]', - 'Anchor[rally::config::end]', - 'Anchor[rally::dbsync::begin]'], - :notify => 'Anchor[rally::dbsync::end]', - :tag => 'openstack-db', - ) - } - end - end on_supported_os({