diff --git a/heat/common/config.py b/heat/common/config.py index 7320a63..5157f93 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -211,7 +211,10 @@ engine_opts = [ ' set to a list of tuples,' ' (stackresourcename, stackname) with list[0] being' ' (None, rootstackname), and heat_resource_name will' - ' be set to the resource\'s name.'))] + ' be set to the resource\'s name.')), + cfg.IntOpt('scheduler_wait_time', + default=1, + help=_('Set timeout between tasks in scheduler.'))] rpc_opts = [ diff --git a/heat/engine/scheduler.py b/heat/engine/scheduler.py index e3e3757..b74869b 100644 --- a/heat/engine/scheduler.py +++ b/heat/engine/scheduler.py @@ -18,6 +18,7 @@ import time import types import eventlet +from oslo_config import cfg from oslo_log import log as logging from oslo_utils import encodeutils from oslo_utils import excutils @@ -26,6 +27,8 @@ import six from heat.common.i18n import _ from heat.common.i18n import _LI +cfg.CONF.import_opt('scheduler_wait_time', 'heat.common.config') + LOG = logging.getLogger(__name__) @@ -171,6 +174,8 @@ class TaskRunner(object): The task will sleep for `wait_time` seconds between steps. To avoid sleeping, pass `None` for `wait_time`. """ + if wait_time == 1: + wait_time = cfg.CONF.scheduler_wait_time self.start(timeout=timeout) # ensure that wait is applied only if task has not completed. if not self.done():