Fix build after commit 9b7e05a
authorMichael Hanselmann <hansmi@google.com>
Tue, 27 Nov 2012 09:30:04 +0000 (10:30 +0100)
committerMichael Hanselmann <hansmi@google.com>
Tue, 27 Nov 2012 11:27:54 +0000 (12:27 +0100)
Commit 9b7e05a didn't quite work as expected: glm.is_owned expects a
locking level, not a lock name.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/cmdlib.py

index 94a1b97..e472dac 100644 (file)
@@ -7623,7 +7623,7 @@ class LUInstanceRename(LogicalUnit):
     # Change the instance lock. This is definitely safe while we hold the BGL.
     # Otherwise the new lock would have to be added in acquired mode.
     assert self.REQ_BGL
-    assert self.glm.is_owned(locking.BGL)
+    assert locking.BGL in self.owned_locks(locking.LEVEL_CLUSTER)
     self.glm.remove(locking.LEVEL_INSTANCE, old_name)
     self.glm.add(locking.LEVEL_INSTANCE, self.op.new_name)