Merge "Add support for setting a timeout for service_validation"
This commit is contained in:
@@ -37,6 +37,10 @@
|
|||||||
# The provider to use for the exec command;
|
# The provider to use for the exec command;
|
||||||
# string; optional; default to 'shell'
|
# string; optional; default to 'shell'
|
||||||
#
|
#
|
||||||
|
# [*timeout*]
|
||||||
|
# The maximum time the command should take;
|
||||||
|
# string; optional; default to '60'
|
||||||
|
#
|
||||||
# [*tries*]
|
# [*tries*]
|
||||||
# Number of times to retry validation;
|
# Number of times to retry validation;
|
||||||
# string; optional; default to '10'
|
# string; optional; default to '10'
|
||||||
@@ -62,6 +66,7 @@ define openstacklib::service_validation(
|
|||||||
$try_sleep = '2',
|
$try_sleep = '2',
|
||||||
$onlyif = undef,
|
$onlyif = undef,
|
||||||
$unless = undef,
|
$unless = undef,
|
||||||
|
$timeout = '60',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if $onlyif and $unless {
|
if $onlyif and $unless {
|
||||||
@@ -72,6 +77,7 @@ define openstacklib::service_validation(
|
|||||||
path => $path,
|
path => $path,
|
||||||
provider => $provider,
|
provider => $provider,
|
||||||
command => $command,
|
command => $command,
|
||||||
|
timeout => $timeout,
|
||||||
tries => $tries,
|
tries => $tries,
|
||||||
try_sleep => $try_sleep,
|
try_sleep => $try_sleep,
|
||||||
onlyif => $onlyif,
|
onlyif => $onlyif,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ describe 'openstacklib::service_validation' do
|
|||||||
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
||||||
:provider => 'shell',
|
:provider => 'shell',
|
||||||
:command => 'nova list',
|
:command => 'nova list',
|
||||||
|
:timeout => '60',
|
||||||
:tries => '10',
|
:tries => '10',
|
||||||
:try_sleep => '2',
|
:try_sleep => '2',
|
||||||
:logoutput => 'on_failure',
|
:logoutput => 'on_failure',
|
||||||
@@ -56,6 +57,7 @@ describe 'openstacklib::service_validation' do
|
|||||||
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
||||||
:provider => 'shell',
|
:provider => 'shell',
|
||||||
:command => 'nova list',
|
:command => 'nova list',
|
||||||
|
:timeout => '60',
|
||||||
:tries => '10',
|
:tries => '10',
|
||||||
:try_sleep => '2',
|
:try_sleep => '2',
|
||||||
:unless => 'pwd',
|
:unless => 'pwd',
|
||||||
@@ -76,6 +78,7 @@ describe 'openstacklib::service_validation' do
|
|||||||
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
||||||
:provider => 'shell',
|
:provider => 'shell',
|
||||||
:command => 'nova list',
|
:command => 'nova list',
|
||||||
|
:timeout => '60',
|
||||||
:tries => '10',
|
:tries => '10',
|
||||||
:try_sleep => '2',
|
:try_sleep => '2',
|
||||||
:onlyif => 'pwd',
|
:onlyif => 'pwd',
|
||||||
|
|||||||
Reference in New Issue
Block a user