]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
lock.ops.unlock_one: Fail sooner on 403, with msg 1850/head
authorZack Cerza <zack@redhat.com>
Wed, 24 May 2023 17:53:19 +0000 (11:53 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 24 May 2023 17:53:19 +0000 (11:53 -0600)
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 <zack@redhat.com>
teuthology/lock/ops.py

index e33e7d5c5a53f92a8f390fb9a1cda0f7be2fa2b9..054ab23f9cdc6f9dc15a39a3c41d823936cf06f7 100644 (file)
@@ -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))