From: Zack Cerza Date: Wed, 24 May 2023 17:53:19 +0000 (-0600) Subject: lock.ops.unlock_one: Fail sooner on 403, with msg X-Git-Tag: 1.2.0~105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2fcae667ce0b8d87f5715b55f1dafbabc12c86b;p=teuthology.git lock.ops.unlock_one: Fail sooner on 403, with msg In the case of e.g. owners values not matching on an unlock attempt, we were exhausting all retries and failing to display the exact reason for the unlock failure. We can simply break on 403 errors and let the rest of the function do its thing. Signed-off-by: Zack Cerza --- diff --git a/teuthology/lock/ops.py b/teuthology/lock/ops.py index e33e7d5c5..054ab23f9 100644 --- a/teuthology/lock/ops.py +++ b/teuthology/lock/ops.py @@ -212,6 +212,8 @@ def unlock_one(ctx, name, user, description=None): if response.ok: log.info('unlocked: %s', name) return response.ok + if response.status_code == 403: + break # Work around https://github.com/kennethreitz/requests/issues/2364 except requests.ConnectionError as e: log.warning("Saw %s while unlocking; retrying...", str(e))