From f2fcae667ce0b8d87f5715b55f1dafbabc12c86b Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 24 May 2023 11:53:19 -0600 Subject: [PATCH] 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 --- teuthology/lock/ops.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teuthology/lock/ops.py b/teuthology/lock/ops.py index e33e7d5c5a..054ab23f9c 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)) -- 2.39.5