From 8c336fa339d9038f5430f7ffd82df3a54e67196f Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Fri, 6 May 2011 15:06:21 -0500 Subject: Review feedback --- nova/compute/api.py | 5 +---- 1 file changed, 1 insertion(+), 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) -- cgit