Merge "Allow setting of the DB sync command path"
This commit is contained in:
commit
8e6d4abde2
|
@ -12,16 +12,21 @@
|
|||
# to the magnum-dbsync command.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*exec_path*]
|
||||
# (optional) The path to use for finding the magnum-db-manage binary.
|
||||
# Defaults to /usr/bin
|
||||
#
|
||||
class magnum::db::sync(
|
||||
$user = 'magnum',
|
||||
$extra_params = '--config-file /etc/magnum/magnum.conf',
|
||||
$exec_path = '/usr/bin',
|
||||
) {
|
||||
|
||||
include ::magnum::deps
|
||||
|
||||
exec { 'magnum-db-sync':
|
||||
command => "magnum-db-manage ${extra_params} upgrade head",
|
||||
path => '/usr/bin',
|
||||
path => $exec_path,
|
||||
user => $user,
|
||||
refreshonly => true,
|
||||
try_sleep => 5,
|
||||
|
|
|
@ -44,6 +44,30 @@ describe 'magnum::db::sync' do
|
|||
}
|
||||
end
|
||||
|
||||
describe "overriding exec_path" do
|
||||
let :params do
|
||||
{
|
||||
:exec_path => '/opt/venvs/magnum/bin',
|
||||
}
|
||||
end
|
||||
|
||||
it {
|
||||
is_expected.to contain_exec('magnum-db-sync').with(
|
||||
:command => 'magnum-db-manage --config-file /etc/magnum/magnum.conf upgrade head',
|
||||
:path => '/opt/venvs/magnum/bin',
|
||||
:user => 'magnum',
|
||||
:refreshonly => 'true',
|
||||
:try_sleep => 5,
|
||||
:tries => 10,
|
||||
:logoutput => 'on_failure',
|
||||
:subscribe => ['Anchor[magnum::install::end]',
|
||||
'Anchor[magnum::config::end]',
|
||||
'Anchor[magnum::dbsync::begin]'],
|
||||
:notify => 'Anchor[magnum::dbsync::end]',
|
||||
)
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
|
Loading…
Reference in New Issue