mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix error where iteration was breaking too soon
This commit is contained in:
parent
5eba12dc62
commit
5f8a2a1ce9
@ -101,10 +101,13 @@ class SSH(object):
|
||||
'''
|
||||
running = {}
|
||||
target_iter = self.targets.__iter__()
|
||||
done = set()
|
||||
while True:
|
||||
done = set()
|
||||
if len(running) < self.opts.get('ssh_max_procs', 5):
|
||||
host = next(target_iter)
|
||||
try:
|
||||
host = next(target_iter)
|
||||
except StopIteration:
|
||||
pass
|
||||
for default in self.defaults:
|
||||
if not default in self.targets[host]:
|
||||
self.targets[host][default] = self.defaults[default]
|
||||
@ -138,7 +141,10 @@ class SSH(object):
|
||||
yield {running[host]['single'].id: 'Bad Return'}
|
||||
done.add(host)
|
||||
for host in done:
|
||||
running.pop(host)
|
||||
if host in running:
|
||||
running.pop(host)
|
||||
if len(done) >= len(self.targets):
|
||||
break
|
||||
|
||||
def run(self):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user