Format gnt-network info group output
authorApollon Oikonomopoulos <apoikos@gmail.com>
Mon, 29 Jul 2013 12:50:00 +0000 (15:50 +0300)
committerGuido Trotter <ultrotter@google.com>
Mon, 29 Jul 2013 14:12:12 +0000 (16:12 +0200)
gnt-network info currently displays the connected group output unformatted:

 # gnt-network info
 ...
   connected to node groups:
    ['med', 'bridged', 'staging']

This patch adds formatting to the node group output.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

NEWS
lib/client/gnt_network.py

diff --git a/NEWS b/NEWS
index 7e24411..a276ffb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ Version 2.7.2
 
 *(unreleased)*
 
+- Change the connected groups format in ``gnt-network info`` output; it
+  was previously displayed as a raw list by mistake.
+
 
 Version 2.7.1
 -------------
index 60d4dee..c0db21b 100644 (file)
@@ -236,8 +236,8 @@ def ShowNetworkConfig(_, args):
 
     if group_list:
       ToStdout("  connected to node groups:")
-      for group in group_list:
-        ToStdout("    %s", group)
+      for group, nic_mode, nic_link in group_list:
+        ToStdout("    %s (%s on %s)", group, nic_mode, nic_link)
     else:
       ToStdout("  not connected to any node group")