LUInstanceRecreateDisks: Actually acquire node resource locks
authorMichael Hanselmann <hansmi@google.com>
Fri, 20 Jan 2012 19:16:20 +0000 (20:16 +0100)
committerMichael Hanselmann <hansmi@google.com>
Mon, 23 Jan 2012 11:37:42 +0000 (12:37 +0100)
Before this change an assertion would fail as the resource locks weren't
actually acquired.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/cmdlib.py

index a11762d..bd9aef5 100644 (file)
@@ -6863,6 +6863,7 @@ class LUInstanceRecreateDisks(LogicalUnit):
       self.needed_locks[locking.LEVEL_NODE] = list(self.op.nodes)
     else:
       self.needed_locks[locking.LEVEL_NODE] = []
+    self.needed_locks[locking.LEVEL_NODE_RES] = []
 
   def DeclareLocks(self, level):
     if level == locking.LEVEL_NODE: