summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-03-24 12:04:24 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-03-24 12:04:24 -0700
commit18eee851d86451737102bacca777c93d3eb66bb3 (patch)
tree8b5411b38c5911ae6558f4c5d0de1320b23b0d79 /nova/utils.py
parent1a7f2e4b817ec7d57d9ae396c34e6103ef972226 (diff)
parent0d42b309ac723d18e6795210bc8d8ca6d295de23 (diff)
downloadnova-18eee851d86451737102bacca777c93d3eb66bb3.tar.gz
nova-18eee851d86451737102bacca777c93d3eb66bb3.tar.xz
nova-18eee851d86451737102bacca777c93d3eb66bb3.zip
trunk merge
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 e4d8a70eb..2f568f739 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,