[node-patches] Change in ovirt-node[master]: network: Pull bridge from vlan if available

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Oct 18 12:48:12 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: network: Pull bridge from vlan if available
......................................................................

network: Pull bridge from vlan if available

Previously the bridge was only pulled from a NIC (and not potential vlan
children of this NIC), which lead to incorrect bootprotocol informations
in the TUI.

rhbz#866585

Change-Id: I1cf7cd1565d1b1adbacfd2bdb95429e75d2b0298
Signed-off-by: Fabian Deutsch <fabiand at redhat.com>
---
M scripts/ovirtnode/network.py
1 file changed, 20 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/55/8655/1

diff --git a/scripts/ovirtnode/network.py b/scripts/ovirtnode/network.py
index 2d5d026..eb14166 100644
--- a/scripts/ovirtnode/network.py
+++ b/scripts/ovirtnode/network.py
@@ -492,19 +492,33 @@
             bridge_cmd = ("/files/etc/sysconfig/network-scripts/" + \
                           "ifcfg-%s/BRIDGE") % str(dev_interface)
             dev_bridge = _functions.augtool_get(bridge_cmd)
+
+            # check for vlans
+            logger.debug("checking for vlan")
+            vlans = glob("/etc/sysconfig/network-scripts/ifcfg-%s.*" %
+                                                                 dev_interface)
+            if (len(vlans) > 0):
+                dev_conf_status = "Configured  "
+                vlanid = vlans[0].split(".")[-1]
+                logger.debug("found vlan %s" % vlanid)
+
+                # if no bridge in nic, check clan-nic for bridge
+                if not dev_bridge:
+                    vlancfg = "ifcfg-%s.%s" % (str(dev_interface), vlanid)
+                    cmd = ("/files/etc/sysconfig/network-scripts/%s/" +
+                           "BRIDGE") % vlancfg
+                    dev_bridge = augtool_get(cmd)
+                    logger.debug("Getting bridge '%s' from vlan: %s" % (
+                                                              dev_bridge, cmd))
+
             if dev_bootproto is None:
+                logger.debug("Looking for bootproto in %s" % dev_bridge)
                 cmd = ("/files/etc/sysconfig/network-scripts/" + \
                        "ifcfg-%s/BOOTPROTO") % str(dev_bridge)
                 dev_bootproto = _functions.augtool_get(cmd)
                 if dev_bootproto is None:
                     dev_bootproto = "Disabled"
                     dev_conf_status = "Unconfigured"
-                    # check for vlans
-                    logger.debug("checking for vlan")
-                    if (len(glob("/etc/sysconfig/network-scripts/ifcfg-" + \
-                        dev_interface + ".*")) > 0):
-                        logger.debug("found vlan")
-                        dev_conf_status = "Configured  "
                 else:
                     dev_conf_status = "Configured  "
             else:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cf7cd1565d1b1adbacfd2bdb95429e75d2b0298
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list