mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch '2016.3' into '2016.11'
Conflicts: - salt/cli/batch.py
This commit is contained in:
commit
c65d602f60
3 changed files with 17 additions and 2 deletions
|
@ -53,7 +53,9 @@ class Batch(object):
|
|||
args.append(self.opts.get('expr_form', 'glob'))
|
||||
|
||||
self.pub_kwargs['yield_pub_data'] = True
|
||||
ping_gen = self.local.cmd_iter(*args, **self.pub_kwargs)
|
||||
ping_gen = self.local.cmd_iter(*args,
|
||||
gather_job_timeout=self.opts['gather_job_timeout'],
|
||||
**self.pub_kwargs)
|
||||
|
||||
# Broadcast to targets
|
||||
fret = set()
|
||||
|
@ -174,6 +176,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)
|
||||
|
|
|
@ -510,6 +510,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
|
||||
|
|
|
@ -24,7 +24,13 @@ class BatchTestCase(TestCase):
|
|||
'''
|
||||
|
||||
def setUp(self):
|
||||
opts = {'batch': '', 'conf_file': {}, 'tgt': '', 'transport': '', 'timeout': 5}
|
||||
opts = {'batch': '',
|
||||
'conf_file': {},
|
||||
'tgt': '',
|
||||
'transport': '',
|
||||
'timeout': 5,
|
||||
'gather_job_timeout': 5}
|
||||
|
||||
mock_client = MagicMock()
|
||||
with patch('salt.client.get_local_client', MagicMock(return_value=mock_client)):
|
||||
with patch('salt.client.LocalClient.cmd_iter', MagicMock(return_value=[])):
|
||||
|
|
Loading…
Add table
Reference in a new issue