From 5ff07e0f24f980674ae25ce5fd2b3deaf9203e48 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 20 Oct 2015 16:34:33 -0600 Subject: [PATCH] Don't retry unlocking when it fails normally We only want to retry when there is a connection error. Signed-off-by: Zack Cerza --- teuthology/lock.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/teuthology/lock.py b/teuthology/lock.py index beaf1db63b..b68b1ed8b3 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -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: -- 2.39.5