]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Break out of retry loop 662/head
authorZack Cerza <zack@redhat.com>
Tue, 20 Oct 2015 15:45:44 +0000 (09:45 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 20 Oct 2015 15:45:44 +0000 (09:45 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/lock.py

index 38809477afe3d1533c1474f1920b7ef673b1be28..beaf1db63b6bd852df13c96409385737908bb958 100644 (file)
@@ -519,10 +519,12 @@ def unlock_one(ctx, name, user, description=None):
         while proceed():
             try:
                 response = requests.put(uri, json.dumps(request))
+                success = response.ok
+                if success:
+                    break
             # Work around https://github.com/kennethreitz/requests/issues/2364
             except requests.exception.ConnectionError as e:
                 log.warn("Saw %s while unlocking; retrying...", str(e))
-    success = response.ok
     if success:
         log.info('unlocked %s', name)
     else: