From 8dbb5954cbf35c0084f505418d121038cc63a618 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 5 Mar 2024 12:29:48 +0900 Subject: [PATCH] Stop hard-coding config file for db sync The ironic-dbsync command by default load service config files. Removing the override allows us to use additional paths such as ironic.conf.d in the future. Note that we still need the hard-coded path for ironic-inspector-dbsync because the service config file is installed at a path different from the default one oslo.config attempts to load (the file name should be "ironic-inspector.conf") Change-Id: I07e066d240dbe4da3eb2fce9040685cc15997ca0 --- manifests/params.pp | 3 +-- spec/classes/ironic_db_online_data_migrations_spec.rb | 4 ++-- spec/classes/ironic_db_sync_spec.rb | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index b36da503..2c91103b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -22,8 +22,7 @@ class ironic::params { include openstacklib::defaults - $dbsync_command = - 'ironic-dbsync --config-file /etc/ironic/ironic.conf' + $dbsync_command = 'ironic-dbsync' $inspector_dbsync_command = 'ironic-inspector-dbsync --config-file /etc/ironic-inspector/inspector.conf upgrade' $client_package = 'python3-ironicclient' diff --git a/spec/classes/ironic_db_online_data_migrations_spec.rb b/spec/classes/ironic_db_online_data_migrations_spec.rb index 8f8591f4..09954893 100644 --- a/spec/classes/ironic_db_online_data_migrations_spec.rb +++ b/spec/classes/ironic_db_online_data_migrations_spec.rb @@ -6,7 +6,7 @@ describe 'ironic::db::online_data_migrations' do it 'runs ironic-db-sync' do is_expected.to contain_exec('ironic-db-online-data-migrations').with( - :command => 'ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations ', + :command => 'ironic-dbsync online_data_migrations ', :path => '/usr/bin', :user => 'ironic', :refreshonly => 'true', @@ -31,7 +31,7 @@ describe 'ironic::db::online_data_migrations' do it { is_expected.to contain_exec('ironic-db-online-data-migrations').with( - :command => 'ironic-dbsync --config-file /etc/ironic/ironic.conf --config-file /etc/ironic/ironic_01.conf online_data_migrations --max-count 100', + :command => 'ironic-dbsync --config-file /etc/ironic/ironic_01.conf online_data_migrations --max-count 100', :path => '/usr/bin', :user => 'ironic', :refreshonly => 'true', diff --git a/spec/classes/ironic_db_sync_spec.rb b/spec/classes/ironic_db_sync_spec.rb index 65a793a0..d35746d9 100644 --- a/spec/classes/ironic_db_sync_spec.rb +++ b/spec/classes/ironic_db_sync_spec.rb @@ -8,7 +8,7 @@ describe 'ironic::db::sync' do it 'runs ironic-manage db_sync' do is_expected.to contain_exec('ironic-dbsync').with( - :command => 'ironic-dbsync --config-file /etc/ironic/ironic.conf ', + :command => 'ironic-dbsync ', :path => '/usr/bin', :user => 'ironic', :refreshonly => 'true', @@ -32,7 +32,7 @@ describe 'ironic::db::sync' do } end it { is_expected.to contain_exec('ironic-dbsync').with( - :command => 'ironic-dbsync --config-file /etc/ironic/ironic.conf --config-file /etc/ironic/ironic_01.conf', + :command => 'ironic-dbsync --config-file /etc/ironic/ironic_01.conf', :path => '/usr/bin', :user => 'ironic', :refreshonly => true,