diff --git a/salt/cloud/__init__.py b/salt/cloud/__init__.py index af6b67c9f0..a777c26a2d 100644 --- a/salt/cloud/__init__.py +++ b/salt/cloud/__init__.py @@ -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