Fix tools/move-instance after networks addition
authorIustin Pop <iustin@google.com>
Tue, 20 Nov 2012 16:44:26 +0000 (17:44 +0100)
committerIustin Pop <iustin@google.com>
Tue, 20 Nov 2012 17:51:49 +0000 (18:51 +0100)
Commits d4117a72 (“Modify LUInstanceCreate to support networks”) and
09a3d21f (“Pass detailed network info in hooks“) expanded the nic
information as computed by _NICToTuple, which means that the format of
the result value from LUInstanceQueryData has changed, and
move-instance has not been changed to deal with this.

A proper fix needs to support correctly importing from old clusters,
right now this is a temporary fix to ensure QA still passes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

tools/move-instance

index 716b00c..8490ecf 100755 (executable)
@@ -496,7 +496,8 @@ class MoveDestExecutor(object):
       constants.INIC_MAC: mac,
       constants.INIC_MODE: mode,
       constants.INIC_LINK: link,
-      } for ip, mac, mode, link in instance["nics"]]
+      constants.INIC_NETWORK: network
+      } for ip, mac, mode, link, network, _ in instance["nics"]]
 
     if len(override_nics) > len(nics):
       raise Error("Can not create new NICs")