Adds custom 'timeout' and 'gather_job_timeout' to 'local_batch' client

Fixes 'local_batch' client to be aware of 'timeout' and 'gather_job_timeout' parameters that are coming from kwargs.
This commit is contained in:
Pablo Suárez Hernández 2017-03-24 12:02:36 +00:00
parent 0e2d52c3ea
commit b1de79abcf
2 changed files with 10 additions and 1 deletions

View file

@ -51,7 +51,9 @@ class Batch(object):
else:
args.append(self.opts.get('expr_form', 'glob'))
ping_gen = self.local.cmd_iter(*args, **self.eauth)
ping_gen = self.local.cmd_iter(*args,
gather_job_timeout=self.opts['gather_job_timeout'],
**self.eauth)
# Broadcast to targets
fret = set()
@ -160,6 +162,7 @@ class Batch(object):
ret=self.opts.get('return', ''),
show_jid=show_jid,
verbose=show_verbose,
gather_job_timeout=self.opts['gather_job_timeout'],
**self.eauth)
# add it to our iterators and to the minion_tracker
iters.append(new_iter)

View file

@ -442,6 +442,12 @@ class LocalClient(object):
'ret': ret,
'batch': batch,
'raw': kwargs.get('raw', False)}
if 'timeout' in kwargs:
opts['timeout'] = kwargs['timeout']
if 'gather_job_timeout' in kwargs:
opts['gather_job_timeout'] = kwargs['gather_job_timeout']
for key, val in six.iteritems(self.opts):
if key not in opts:
opts[key] = val