summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-05-06 15:06:21 -0500
committerJosh Kearney <josh@jk0.org>2011-05-06 15:06:21 -0500
commit8c336fa339d9038f5430f7ffd82df3a54e67196f (patch)
treebbce6cefb0b1a44386cce31efd9b60c900ac046f
parent311c774e1109d6ce0449f0d06346078020ffa4e0 (diff)
Review feedback
-rw-r--r--nova/compute/api.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index a7276ad2d..63884be97 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -484,14 +484,11 @@ class API(base.Base):
def _find_host(self, context, instance_id):
"""Find the host associated with an instance."""
- host = None
- attempts = 10
- while attempts:
+ for attempts in xrange(10):
instance = self.get(context, instance_id)
host = instance["host"]
if host:
return host
- attempts -= 1
time.sleep(1)
raise exception.Error(_("Unable to find host for Instance %s")
% instance_id)