From f500d80b14d82dc20eaea21fd0b16d7b5e521d9d Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 20 Nov 2012 17:44:26 +0100
Subject: [PATCH] Fix tools/move-instance after networks addition
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/move-instance b/tools/move-instance
index 716b00c4d..8490ecf9d 100755
--- a/tools/move-instance
+++ b/tools/move-instance
@@ -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")
-- 
GitLab