[node-patches] Change in ovirt-node[master]: support flash lights to identify which nics belong to bond

hadong0720 at gmail.com hadong0720 at gmail.com
Thu Sep 12 09:13:01 UTC 2013


hadong has uploaded a new change for review.

Change subject: support flash lights to identify which nics belong to bond
......................................................................

support flash lights to identify which nics belong to bond

Change-Id: I5fa299cb84e2bcd3a873b9df88baee9f9d5cf7e1
Bug-Url:https://bugzilla.redhat.com/show_bug.cgi?id=1007311
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/setup/core/network_page.py
M src/ovirt/node/utils/network.py
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/75/19175/1

diff --git a/src/ovirt/node/setup/core/network_page.py b/src/ovirt/node/setup/core/network_page.py
index f9586f3..02f349e 100644
--- a/src/ovirt/node/setup/core/network_page.py
+++ b/src/ovirt/node/setup/core/network_page.py
@@ -297,7 +297,12 @@
 
         if "dialog.nic.identify" in changes:
             ifname = self._model_extra["dialog.nic.ifname"]
-            utils.network.NIC(ifname).identify()
+            if ifname[0:4] == "bond":
+                mbond = defaults.NicBonding().retrieve()
+                nic = utils.network.NIC(ifname)
+                utils.network.BondedNIC(nic, mbond["slaves"]).identify()
+            else:
+                utils.network.NIC(ifname).identify()
             self.application.notice("Flashing lights now")
             return
 
diff --git a/src/ovirt/node/utils/network.py b/src/ovirt/node/utils/network.py
index 7169385..1352df9 100644
--- a/src/ovirt/node/utils/network.py
+++ b/src/ovirt/node/utils/network.py
@@ -22,6 +22,7 @@
 from ovirt.node.config.network import NicConfig
 from ovirt.node.utils import fs
 from ovirt.node.utils.fs import File
+from ovirt.node.config import defaults
 import glob
 import gudev
 import logging
@@ -453,7 +454,8 @@
         self.slave_nics = [NIC(n) for n in slave_nics]
 
     def identify(self):
-        (slave.identify() for slave in self.slave_nics)
+        for slave in self.slave_nics:
+            slave.identify()
 
     def __str__(self):
         return self.build_str(["ifname", "slave_nics"])


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fa299cb84e2bcd3a873b9df88baee9f9d5cf7e1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list