Force conflicts check in LUNetworkDisconnect
authorHelga Velroyen <helgav@google.com>
Wed, 30 Jan 2013 16:12:26 +0000 (17:12 +0100)
committerGuido Trotter <ultrotter@google.com>
Tue, 12 Feb 2013 13:39:53 +0000 (14:39 +0100)
commit37a978e753a01f76b9b2efde4cdb9ebd2acf37b7
tree43390aeb0f2e8c6139567bf298f74c62d78f8561
parentbecf9d5c6e1ce9fe853e1a93f71342f95ad0ffea
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.

This is a cherry-pick of commit 6bb939a.

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