[node-patches] Change in ovirt-node[master]: If managed, give NIC names more room in the details table

rbarry at redhat.com rbarry at redhat.com
Wed Apr 2 15:27:21 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: If managed, give NIC names more room in the details table
......................................................................

If managed, give NIC names more room in the details table

Since the engine allows for NIC names up to 15 characters long
(assuming bond+11), we should expand that column so we can see the
entire length. On 80x24, this means we lose the vendor column,
but are able to keep the MAC field, at least.

Change-Id: I2d1591e22da87e6224818f416144ea7de6427c83
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1083106
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/core/network_page.py
1 file changed, 16 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/72/26372/1

diff --git a/src/ovirt/node/setup/core/network_page.py b/src/ovirt/node/setup/core/network_page.py
index 152e38c..738a036 100644
--- a/src/ovirt/node/setup/core/network_page.py
+++ b/src/ovirt/node/setup/core/network_page.py
@@ -41,7 +41,10 @@
 
 class NicTable(ui.Table):
     def __init__(self, path, height=3, multi=False):
-        header = "Device  Status       Model         MAC Address"
+        if not has_managed_ifnames():
+            header = "Device  Status       Model         MAC Address"
+        else:
+            header = "Device          Status       MAC Address      "
         if multi:
             header = "    " + header
 
@@ -66,11 +69,18 @@
             else:
                 is_cfg = ("Configured" if nic.is_configured() else
                           "Unconfigured")
-            description = " ".join([justify(nic.ifname, 7),
-                                    justify(is_cfg, 12),
-                                    justify(nic.vendor, 13),
-                                    justify(nic.hwaddr, 17)
-                                    ])
+
+            fields = [justify(nic.ifname, 7),
+                      justify(is_cfg, 12)]
+
+            if has_managed_ifnames():
+                fields[0] = justify(nic.ifname, 15)
+            if not has_managed_ifnames():
+                fields.append(justify(nic.vendor, 13))
+
+            fields.append(justify(nic.hwaddr, 17))
+            description = " ".join(fields)
+
             node_nics.append((name, description))
         return node_nics
 


-- 
To view, visit http://gerrit.ovirt.org/26372
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d1591e22da87e6224818f416144ea7de6427c83
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list