Edward Haas has uploaded a new change for review.

Change subject: net: Normalize management network defaultRoute
......................................................................

net: Normalize management network defaultRoute

The management network should always include defaultRoute=True.  With
ovirt-node<=3.5, the management network is initally set from the tui and
does not set defaultRoute.  defaultRoute is normalized internally to
True without adding it to the persistent config.

The fix introduces a normalization of the persistent config, such that
the management network will be marked with defaultRoute=True even if
defaultRoute is missing.

This issue is relevant for upgrades from ovirt-node<=3.5.

Change-Id: I3c596afaf6e57944962ebc874bd6a28374cfe382
Bug-Url: https://bugzilla.redhat.com/1293562
Signed-off-by: Edward Haas <[email protected]>
---
M lib/vdsm/kernelconfig.py
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/51594/1

diff --git a/lib/vdsm/kernelconfig.py b/lib/vdsm/kernelconfig.py
index 99940d1..7b69be4 100644
--- a/lib/vdsm/kernelconfig.py
+++ b/lib/vdsm/kernelconfig.py
@@ -20,8 +20,10 @@
 from __future__ import absolute_import
 import copy
 import netaddr
+import six
 import string
 
+from . import constants
 from .netinfo import addresses
 from .netinfo import bonding
 from .netinfo import bridges
@@ -248,14 +250,15 @@
 
 
 def _normalize_address(config_copy):
-    for net_attr in config_copy.networks.itervalues():
+    for net_name, net_attr in six.iteritems(config_copy.networks):
         prefix = net_attr.pop('prefix', None)
         if prefix is not None:
             net_attr['netmask'] = addresses.prefix2netmask(int(prefix))
         if 'ipv6addr' in net_attr:
             net_attr['ipv6addr'] = [net_attr['ipv6addr']]
         if 'defaultRoute' not in net_attr:
-            net_attr['defaultRoute'] = False
+            net_attr['defaultRoute'] = net_name in \
+                constants.LEGACY_MANAGEMENT_NETWORKS
 
 
 def _normalize_ifcfg_keys(config_copy):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c596afaf6e57944962ebc874bd6a28374cfe382
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to