salt.cloud: race if item was removed in another loop

This commit is contained in:
Mathieu Le Marec - Pasquet 2014-03-01 14:55:56 +00:00
parent 0d8661b9a3
commit 94c3c68ca9

View File

@ -147,7 +147,7 @@ def enter_mainloop(target,
iterable = [[queue, [arg], kwargs] for arg in mapped_args]
ret = pool.map(func=target, iterable=iterable)
else:
ret = pool.apply(target, [queue, args, kwargs])
ret = pool.apply(target, [queue, args, kwargs])
while True:
test = queue.get()
if test in ['ERROR', 'KEYBOARDINT']:
@ -791,7 +791,8 @@ class Cloud(object):
if driver not in processed[alias]:
processed[alias][driver] = {}
processed[alias][driver][name] = ret_multip[name]
names.remove(name)
if name in names:
names.remove(name)
# not destroying in parallel
else:
@ -808,7 +809,8 @@ class Cloud(object):
if driver not in processed[alias]:
processed[alias][driver] = {}
processed[alias][driver][name] = ret
names.remove(name)
if name in names:
names.remove(name)
# now the processed data structure contains the output from either
# the parallel or non-parallel destroy and we should finish up