Change in vdsm[ovirt-3.5]: net: ifcfg: ONBOOT=yes on all persisted network files.

ibarkan at redhat.com ibarkan at redhat.com
Sun Jun 28 20:50:29 UTC 2015


Hello Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/42962

to review the following change.

Change subject: net: ifcfg: ONBOOT=yes on all persisted network files.
......................................................................

net: ifcfg: ONBOOT=yes on all persisted network files.

This will cause network service to configure those networks long
before vdsm starts. after https://gerrit.ovirt.org/#/c/42355/
vdsm will only restore changed networks.

Change-Id: Ia942827745945f0f2e2a0e1691996824511cc111
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1203422
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/42362
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/network/configurators/ifcfg.py
M vdsm/network/models.py
2 files changed, 4 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/42962/1

diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index 60bbc66..cf42256 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -609,10 +609,7 @@
         if bridge.stp is not None:
             conf += 'STP=%s\n' % ('on' if bridge.stp else 'off')
         ipconfig = bridge.ipConfig
-        if not self.unifiedPersistence or ipconfig.defaultRoute:
-            conf += 'ONBOOT=%s\n' % 'yes'
-        else:
-            conf += 'ONBOOT=%s\n' % 'no'
+        conf += 'ONBOOT=%s\n' % 'yes'
         defaultRoute = ConfigWriter._toIfcfgFormat(ipconfig.defaultRoute)
         ipconfig = ipconfig._replace(defaultRoute=defaultRoute)
 
@@ -626,10 +623,7 @@
         opts['hotplug'] = 'no'  # So that udev doesn't trigger an ifup
         if vlan.bridge:
             conf += 'BRIDGE=%s\n' % pipes.quote(vlan.bridge.name)
-        if not self.unifiedPersistence or vlan.serving_default_route:
-            conf += 'ONBOOT=%s\n' % 'yes'
-        else:
-            conf += 'ONBOOT=%s\n' % 'no'
+        conf += 'ONBOOT=%s\n' % 'yes'
         ipconfig = vlan.ipConfig
         defaultRoute = ConfigWriter._toIfcfgFormat(ipconfig.defaultRoute)
         ipconfig = ipconfig._replace(defaultRoute=defaultRoute)
@@ -641,10 +635,7 @@
         opts['hotplug'] = 'no'  # So that udev doesn't trigger an ifup
         if bond.bridge:
             conf += 'BRIDGE=%s\n' % pipes.quote(bond.bridge.name)
-        if not self.unifiedPersistence or bond.serving_default_route:
-            conf += 'ONBOOT=%s\n' % 'yes'
-        else:
-            conf += 'ONBOOT=%s\n' % 'no'
+        conf += 'ONBOOT=%s\n' % 'yes'
 
         ipconfig, mtu = self._getIfaceConfValues(bond)
         self._createConfFile(conf, bond.name, ipconfig, mtu, **opts)
@@ -667,10 +658,7 @@
             conf += 'BRIDGE=%s\n' % pipes.quote(nic.bridge.name)
         if nic.bond:
             conf += 'MASTER=%s\nSLAVE=yes\n' % pipes.quote(nic.bond.name)
-        if not self.unifiedPersistence or nic.serving_default_route:
-            conf += 'ONBOOT=%s\n' % 'yes'
-        else:
-            conf += 'ONBOOT=%s\n' % 'no'
+        conf += 'ONBOOT=%s\n' % 'yes'
 
         ethtool_opts = getEthtoolOpts(nic.name)
         if ethtool_opts:
diff --git a/vdsm/network/models.py b/vdsm/network/models.py
index f4b698f..8e33950 100644
--- a/vdsm/network/models.py
+++ b/vdsm/network/models.py
@@ -71,15 +71,6 @@
             return self.master
         return None
 
-    @property
-    def serving_default_route(self):
-        device = self
-        while device:
-            if device.ipConfig.defaultRoute:
-                return True
-            device = device.master
-        return False
-
 
 class Nic(NetDevice):
     def __init__(self, name, configurator, ipconfig=None, mtu=None,


-- 
To view, visit https://gerrit.ovirt.org/42962
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia942827745945f0f2e2a0e1691996824511cc111
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list