From e1137eb634d6fef7cfeab8ac65e5f70eef9f75a9 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Wed, 1 Dec 2010 18:33:27 +0100 Subject: [PATCH] locking: Clarify message for removed locks Just being told that a lock doesn't exist can be confusing. One case were this happens is when a job (e.g. instance modify) waits for a job removing the instance (e.g. export with remove). Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/locking.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/locking.py b/lib/locking.py index 934638f46..78fdd93e1 100644 --- a/lib/locking.py +++ b/lib/locking.py @@ -1101,8 +1101,8 @@ class LockSet: # element is not there anymore. continue - raise errors.LockError("Non-existing lock %s in set %s" % - (lname, self.name)) + raise errors.LockError("Non-existing lock %s in set %s (it may have" + " been removed)" % (lname, self.name)) acquire_list.append((lname, lock)) @@ -1134,8 +1134,8 @@ class LockSet: # particular element is not there anymore. continue - raise errors.LockError("Non-existing lock %s in set %s" % - (lname, self.name)) + raise errors.LockError("Non-existing lock %s in set %s (it may" + " have been removed)" % (lname, self.name)) if not acq_success: # Couldn't get lock or timeout occurred -- GitLab