Fix locking in LUNetworkConnect()
authorDimitris Aragiorgis <dimara@grnet.gr>
Tue, 26 Feb 2013 01:39:26 +0000 (03:39 +0200)
committerGuido Trotter <ultrotter@google.com>
Tue, 26 Feb 2013 01:53:01 +0000 (17:53 -0800)
Locks for group instances are aquired only if conflicts are checked.
To this end we must _CheckNodeGroupInstances() only then otherwise
this check will always fail (owned_instances will be []).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/cmdlib.py

index 1ac5c24..d80d854 100644 (file)
@@ -16701,7 +16701,8 @@ class LUNetworkConnect(LogicalUnit):
 
     # Check if locked instances are still correct
     owned_instances = frozenset(self.owned_locks(locking.LEVEL_INSTANCE))
-    _CheckNodeGroupInstances(self.cfg, self.group_uuid, owned_instances)
+    if self.op.conflicts_check:
+      _CheckNodeGroupInstances(self.cfg, self.group_uuid, owned_instances)
 
     self.netparams = {
       constants.NIC_MODE: self.network_mode,