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>
# 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,