summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-03-24 15:38:26 -0500
committerJosh Kearney <josh@jk0.org>2011-03-24 15:38:26 -0500
commita07854e38eda33fda9bc3523d8dd85caae594ea0 (patch)
tree223cfb6611f70baaf3748b4f21b38d7cf785d594 /nova/utils.py
parentb5b2423df78b1c4f7ad81db25e96cf68726653b5 (diff)
parenta0ea76b26a7725efb2fc4a811dff66b4f8bff6b7 (diff)
downloadnova-a07854e38eda33fda9bc3523d8dd85caae594ea0.tar.gz
nova-a07854e38eda33fda9bc3523d8dd85caae594ea0.tar.xz
nova-a07854e38eda33fda9bc3523d8dd85caae594ea0.zip
Merged trunk
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 838e11b3c..7880c609c 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -171,10 +171,6 @@ def execute(*cmd, **kwargs):
stdout=stdout,
stderr=stderr,
cmd=' '.join(cmd))
- # NOTE(termie): this appears to be necessary to let the subprocess
- # call clean something up in between calls, without
- # it two execute calls in a row hangs the second one
- greenthread.sleep(0)
return result
except ProcessExecutionError:
if not attempts:
@@ -183,6 +179,11 @@ def execute(*cmd, **kwargs):
LOG.debug(_("%r failed. Retrying."), cmd)
if delay_on_retry:
greenthread.sleep(random.randint(20, 200) / 100.0)
+ finally:
+ # NOTE(termie): this appears to be necessary to let the subprocess
+ # call clean something up in between calls, without
+ # it two execute calls in a row hangs the second one
+ greenthread.sleep(0)
def ssh_execute(ssh, cmd, process_input=None,