From 14ea930220c6dced74473a06cc470caed9acb2c4 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Mon, 21 Sep 2009 11:59:21 +0100
Subject: [PATCH] gnt-instance info: fix nic display

In branch-2.1 the conversion of NICs to Tuples has been unified to the
_NICListToTuple function, which is used by both hook generation and
instance info generation. Unfortunately the ip and mac fields got
swapped from what instance info expected, so the mac is shown as ip, and
vice versa. Fixing this.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 scripts/gnt-instance | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index fd758d49b..976be93af 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1137,7 +1137,7 @@ def ShowInstanceConfig(opts, args):
     buf.write("    - memory: %dMiB\n" %
               instance["be_actual"][constants.BE_MEMORY])
     buf.write("    - NICs:\n")
-    for idx, (mac, ip, mode, link) in enumerate(instance["nics"]):
+    for idx, (ip, mac, mode, link) in enumerate(instance["nics"]):
       buf.write("      - nic/%d: MAC: %s, IP: %s, mode: %s, link: %s\n" %
                 (idx, mac, ip, mode, link))
     buf.write("  Disks:\n")
-- 
GitLab