Bootstrap delay option for salt-cloud

This commit is contained in:
Mike Place 2016-11-02 22:01:20 +13:00
parent 9446e48da0
commit 6e42b0e157
No known key found for this signature in database
GPG key ID: 9136F4F13705CFD3
2 changed files with 11 additions and 0 deletions

View file

@ -16,6 +16,7 @@ from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import time
import logging
from salt.ext.six.moves import input
@ -363,6 +364,10 @@ class SaltCloud(parsers.SaltCloudParser):
self.handle_exception(msg, exc)
elif self.options.bootstrap:
if self.options.bootstrap_delay:
log.info('Sleeping for {0} seconds for bootstrap delay.'.format(self.options.bootstrap_delay))
time.sleep(self.options.bootstrap_delay)
log.info('Bootstrap delay finished. Onward!')
host = self.options.bootstrap
if len(self.args) > 0:
if '=' not in self.args[0]:

View file

@ -1404,6 +1404,12 @@ class ExecutionOptionsMixIn(six.with_metaclass(MixInMeta, object)):
action='store_true',
help='Update salt-bootstrap to the latest stable bootstrap release.'
)
group.add_option(
'--bootstrap-delay',
default=False,
action='store_true',
help='Delay before bootstrap is attempted.'
)
group.add_option(
'-y', '--assume-yes',
default=False,