Merge "Make throttle optional"
This commit is contained in:
commit
41f132edb5
|
@ -163,14 +163,17 @@ class StrategyModule(BASE.TripleoBase):
|
||||||
task_vars = self._variable_manager.get_vars(**vars_params)
|
task_vars = self._variable_manager.get_vars(**vars_params)
|
||||||
templar = Templar(loader=self._loader, variables=task_vars)
|
templar = Templar(loader=self._loader, variables=task_vars)
|
||||||
|
|
||||||
try:
|
# if task has a throttle attribute, check throttle e.g. ansible > 2.9
|
||||||
throttle = int(templar.template(task.throttle))
|
throttle = getattr(task, 'throttle', None)
|
||||||
except Exception as e:
|
if throttle is not None:
|
||||||
raise AnsibleError("Failed to throttle: {}".format(e),
|
try:
|
||||||
obj=task._df,
|
throttle = int(templar.template(throttle))
|
||||||
orig_exc=e)
|
except Exception as e:
|
||||||
if self._check_throttle(throttle, task):
|
raise AnsibleError("Failed to throttle: {}".format(e),
|
||||||
raise TripleoFreeBreak()
|
obj=task._df,
|
||||||
|
orig_exc=e)
|
||||||
|
if self._check_throttle(throttle, task):
|
||||||
|
raise TripleoFreeBreak()
|
||||||
|
|
||||||
# _blocked_hosts is used in the base strategy to keep track of hosts in
|
# _blocked_hosts is used in the base strategy to keep track of hosts in
|
||||||
# that have tasks in queue
|
# that have tasks in queue
|
||||||
|
|
Loading…
Reference in New Issue