Edward Haas has uploaded a new change for review. Change subject: net: Canonize persistent and running net config ......................................................................
net: Canonize persistent and running net config In order to support persistent configuration which has been saved in an older version, canonize & normalize the configuration upon reading it. Change-Id: I970f99c8ad4a58f64322560c25bffe09b69bbc3c Signed-off-by: Edward Haas <edwa...@redhat.com> --- M lib/vdsm/netconfpersistence.py M tests/netconfpersistenceTests.py 2 files changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/52718/1 diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py index 80f38c5..7351514 100644 --- a/lib/vdsm/netconfpersistence.py +++ b/lib/vdsm/netconfpersistence.py @@ -30,6 +30,7 @@ from . import commands from . import constants from . import utils +from vdsm.network.netcanonize import canonize_networks CONF_RUN_DIR = constants.P_VDSM_RUN + 'netconf/' # The persistent path is inside of an extra "persistence" dir in order to get @@ -108,8 +109,9 @@ def __init__(self, savePath): self.networksPath = os.path.join(savePath, 'nets', '') self.bondingsPath = os.path.join(savePath, 'bonds', '') - super(Config, self).__init__(self._getConfigs(self.networksPath), - self._getConfigs(self.bondingsPath)) + nets = self._getConfigs(self.networksPath) + canonize_networks(nets) + super(Config, self).__init__(nets, self._getConfigs(self.bondingsPath)) def delete(self): self.networks = {} diff --git a/tests/netconfpersistenceTests.py b/tests/netconfpersistenceTests.py index 581439a..8834f83 100644 --- a/tests/netconfpersistenceTests.py +++ b/tests/netconfpersistenceTests.py @@ -32,7 +32,8 @@ NETWORK = 'luke' -NETWORK_ATTRIBUTES = {'bonding': 'bond0', 'bridged': True, 'vlan': 1} +NETWORK_ATTRIBUTES = {'bonding': 'bond0', 'bridged': True, 'vlan': 1, + 'mtu': 1500, 'stp': False} BONDING = 'skywalker' BONDING_ATTRIBUTES = {'options': 'mode=4 miimon=100', 'nics': ['eth0', 'eth1']} -- To view, visit https://gerrit.ovirt.org/52718 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I970f99c8ad4a58f64322560c25bffe09b69bbc3c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas <edwa...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches