[node-patches] Change in ovirt-node[master]: Don't show configured NICs in the bond dialog

rbarry at redhat.com rbarry at redhat.com
Wed Apr 9 14:23:44 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Don't show configured NICs in the bond dialog
......................................................................

Don't show configured NICs in the bond dialog

If a NIC is already configured, we probably won't want to
unconfigure it to add it to a bond, much less let users
accidentally select it. Don't show it if it's configured.

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/26/26626/1

diff --git a/src/ovirt/node/setup/core/network_page.py b/src/ovirt/node/setup/core/network_page.py
index 738a036..d1c593f 100644
--- a/src/ovirt/node/setup/core/network_page.py
+++ b/src/ovirt/node/setup/core/network_page.py
@@ -40,7 +40,7 @@
 
 
 class NicTable(ui.Table):
-    def __init__(self, path, height=3, multi=False):
+    def __init__(self, path, height=3, multi=False, filter=False):
         if not has_managed_ifnames():
             header = "Device  Status       Model         MAC Address"
         else:
@@ -51,10 +51,10 @@
         super(NicTable, self).__init__(path,
                                        "Available System NICs",
                                        header,
-                                       self._get_nics(),
+                                       self._get_nics(filter),
                                        height=height, multi=multi),
 
-    def _get_nics(self):
+    def _get_nics(self, filter):
         def justify(txt, l):
             txt = txt if txt else ""
             return txt.ljust(l)[0:l]
@@ -69,6 +69,9 @@
             else:
                 is_cfg = ("Configured" if nic.is_configured() else
                           "Unconfigured")
+
+            if is_cfg == "Configured" and filter:
+                pass
 
             fields = [justify(nic.ifname, 7),
                       justify(is_cfg, 12)]
@@ -620,5 +623,5 @@
                    ui.Divider("bond.divider[0]"),
                    ui.Entry("bond.options", _("Options:")),
                    ui.Divider("bond.divider[1]"),
-                   NicTable("bond.slaves", multi=True)]
+                   NicTable("bond.slaves", multi=True, filter=True)]
         super(CreateBondDialog, self).__init__(path, _("Create Bond"), widgets)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79095cf299f5194b3466d09e35894ecd7affc279
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