mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
fix 34922, StopIteration should not throw exception out
This commit is contained in:
parent
67692f868c
commit
fe338ff41f
@ -53,15 +53,17 @@ class Batch(object):
|
||||
|
||||
ping_gen = self.local.cmd_iter(*args, **self.eauth)
|
||||
|
||||
# Broadcast to targets
|
||||
fret = set()
|
||||
try:
|
||||
for ret in ping_gen:
|
||||
m = next(six.iterkeys(ret))
|
||||
if m is not None:
|
||||
fret.add(m)
|
||||
return (list(fret), ping_gen)
|
||||
except StopIteration:
|
||||
raise salt.exceptions.SaltClientError('No minions matched the target.')
|
||||
if not self.quiet:
|
||||
print_cli('No minions matched the target.')
|
||||
return list(fret), ping_gen
|
||||
|
||||
def get_bnum(self):
|
||||
'''
|
||||
@ -101,6 +103,9 @@ class Batch(object):
|
||||
'list',
|
||||
]
|
||||
bnum = self.get_bnum()
|
||||
# No targets to run
|
||||
if not self.minions:
|
||||
return
|
||||
to_run = copy.deepcopy(self.minions)
|
||||
active = []
|
||||
ret = {}
|
||||
|
Loading…
Reference in New Issue
Block a user