Force conflicts check in LUNetworkDisconnect
authorHelga Velroyen <helgav@google.com>
Wed, 30 Jan 2013 16:12:26 +0000 (17:12 +0100)
committerHelga Velroyen <helgav@google.com>
Wed, 30 Jan 2013 17:26:46 +0000 (18:26 +0100)
commit6bb939a2171bcfa554736260543c0bd7b5ae0e51
tree0e2516290e046612e32418bd1555c90413e85457
parentea2bcb821f63e3b68222b2bb9ecff3ee2a400874
Force conflicts check in LUNetworkDisconnect

Until now if one disconnects a network with --no-conflicts-check
and then remove it, there is a possibility to leave instances with NICs
referencing non-existing networks. This causes network queries,
instance removal and modification to fail.

This patch allows a network to be disconnected from a nodegroup,
only if instances residing in the nodegroup do not have NICs attached
to the network. Otherwise OpPrereqError is raised. The
--no-conflicts-check option is removed from the gnt-network disconnect
command as well.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
lib/client/gnt_network.py
lib/cmdlib.py
lib/opcodes.py