Change in vdsm[master]: netinfo: Drop ifcfg reading from _getNetInfo

asegurap at redhat.com asegurap at redhat.com
Mon Nov 10 15:18:34 UTC 2014


Antoni Segura Puimedon has uploaded a new change for review.

Change subject: netinfo: Drop ifcfg reading from _getNetInfo
......................................................................

netinfo: Drop ifcfg reading from _getNetInfo

For backwards compatibility we need to report the bridge 'cfg' field
in the network attributes dictionary. Up until now, this was done by
re-reading the 'ifcfg' files of the bridge. After this change, we
will just be adding the 'cfg' field that we already generated for the
bridge device.

Note that 'BOOTPROTO' reporting is already part of _devinfo, so we
don't need that part.

Change-Id: I2a80251cc45792ba5511d22bce9451fb3b36689d
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/35012/1

diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index d2ef90b..20eadbe 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -448,8 +448,8 @@
     data = {}
     try:
         if bridged:
-            data.update({'ports': ports(iface), 'stp': bridge_stp_state(iface),
-                         'cfg': getIfaceCfg(iface)})
+            data.update({'ports': ports(iface),
+                         'stp': bridge_stp_state(iface)})
         else:
             # ovirt-engine-3.1 expects to see the "interface" attribute iff the
             # network is bridgeless. Please remove the attribute and this
@@ -647,13 +647,6 @@
     return d
 
 
-def _cfgBootprotoCompat(networks):
-    """Set network 'cfg' 'BOOTPROTO' for backwards engine compatibility."""
-    for netAttrs in networks.itervalues():
-        if netAttrs['bridged'] and 'BOOTPROTO' not in netAttrs['cfg']:
-            netAttrs['cfg']['BOOTPROTO'] = netAttrs['bootproto4']
-
-
 def get(vdsmnets=None):
     d = {'bondings': {}, 'bridges': {}, 'networks': {}, 'nics': {},
          'vlans': {}}
@@ -683,7 +676,9 @@
         if dev.isBOND():
             _bondOptsCompat(devinfo)
 
-    _cfgBootprotoCompat(d['networks'])
+    for net, attrs in d['networks']:
+        if attrs['bridged']:
+            attrs['cfg'] = d['bridges'][net]['cfg']
 
     return d
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a80251cc45792ba5511d22bce9451fb3b36689d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>


More information about the vdsm-patches mailing list