]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Don't retry unlocking when it fails normally
authorZack Cerza <zack@redhat.com>
Tue, 20 Oct 2015 22:34:33 +0000 (16:34 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 20 Oct 2015 22:34:33 +0000 (16:34 -0600)
We only want to retry when there is a connection error.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/lock.py

index beaf1db63b6bd852df13c96409385737908bb958..b68b1ed8b32f94baf5e32f4db7173b9c99df9ee3 100644 (file)
@@ -519,12 +519,11 @@ def unlock_one(ctx, name, user, description=None):
         while proceed():
             try:
                 response = requests.put(uri, json.dumps(request))
-                success = response.ok
-                if success:
-                    break
+                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: