diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index dec51252..5c483b2a 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -10,9 +10,14 @@ # to the gnocchi-db-sync command. # Defaults to undef # +# [*db_sync_timeout*] +# (Optional) Timeout for the execution of the db_sync +# Defaults to 300 +# class gnocchi::db::sync ( - $user = 'gnocchi', - $extra_opts = undef, + $user = 'gnocchi', + $extra_opts = undef, + $db_sync_timeout = 300, ){ include gnocchi::deps @@ -24,6 +29,7 @@ class gnocchi::db::sync ( user => $user, try_sleep => 5, tries => 10, + timeout => $db_sync_timeout, logoutput => on_failure, subscribe => [ Anchor['gnocchi::install::end'], diff --git a/releasenotes/notes/add_db_sync_timeout-8363be2e21ddc1e8.yaml b/releasenotes/notes/add_db_sync_timeout-8363be2e21ddc1e8.yaml new file mode 100644 index 00000000..233445f6 --- /dev/null +++ b/releasenotes/notes/add_db_sync_timeout-8363be2e21ddc1e8.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds db_sync_timeout parameter to db sync. diff --git a/spec/classes/gnocchi_db_sync_spec.rb b/spec/classes/gnocchi_db_sync_spec.rb index 29c3d659..05d086cc 100644 --- a/spec/classes/gnocchi_db_sync_spec.rb +++ b/spec/classes/gnocchi_db_sync_spec.rb @@ -14,6 +14,7 @@ describe 'gnocchi::db::sync' do :refreshonly => 'true', :try_sleep => 5, :tries => 10, + :timeout => 300, :logoutput => 'on_failure', :subscribe => ['Anchor[gnocchi::install::end]', 'Anchor[gnocchi::config::end]', @@ -22,10 +23,11 @@ describe 'gnocchi::db::sync' do :tag => 'openstack-db', ) end - describe "overriding extra_opts" do + describe "overriding params" do let :params do { - :extra_opts => '--skip-storage', + :extra_opts => '--skip-storage', + :db_sync_timeout => 750, } end it { is_expected.to contain_exec('gnocchi-db-sync').with( @@ -35,6 +37,7 @@ describe 'gnocchi::db::sync' do :refreshonly => 'true', :try_sleep => 5, :tries => 10, + :timeout => 750, :logoutput => 'on_failure', :subscribe => ['Anchor[gnocchi::install::end]', 'Anchor[gnocchi::config::end]',