From 9b154270427ac266a4cd02773900eaffb739c8dc Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 12 Jan 2010 15:12:27 +0100
Subject: [PATCH] locking: Append to list outside error handling block

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/locking.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/locking.py b/lib/locking.py
index 103d64501..b738ed64d 100644
--- a/lib/locking.py
+++ b/lib/locking.py
@@ -895,7 +895,6 @@ class LockSet:
     for lname in utils.UniqueSequence(names):
       try:
         lock = self.__lockdict[lname] # raises KeyError if lock is not there
-        acquire_list.append((lname, lock))
       except KeyError:
         if want_all:
           # We are acquiring all the set, it doesn't matter if this particular
@@ -904,6 +903,8 @@ class LockSet:
 
         raise errors.LockError("Non-existing lock in set (%s)" % lname)
 
+      acquire_list.append((lname, lock))
+
     # This will hold the locknames we effectively acquired.
     acquired = set()
 
-- 
GitLab