Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
gerrit-hooks has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 5: * #1367378::Update tracker: OK * Set MODIFIED::bug 1367378#1367378IGNORE, not all related patches are closed, check 64095 -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Dan Kenigsberg has submitted this change and it was merged. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. net: Consume ifcfg files that have a non vdsm standard name VDSM assumes that the ifcfg files which represent network devices are named in the following format: ifcfg- If the host is set initially by Network Manager, the names of the files do no correspond to the expected format. This patch adjusts the ifcfg file name to the mentioned format and erases any other ifcfg files that correspond to the same device. This is not a NM friendly patch, it assumes that NM is not active while setupNetworks is issued. Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Bug-Url: https://bugzilla.redhat.com/1367378 Signed-off-by: Edward HaasReviewed-on: https://gerrit.ovirt.org/63990 Continuous-Integration: Jenkins CI Reviewed-by: Petr Horáček Reviewed-by: Dan Kenigsberg --- M lib/vdsm/network/configurators/ifcfg.py M tests/network/func_net_basic_test.py 2 files changed, 70 insertions(+), 0 deletions(-) Approvals: Jenkins CI: Passed CI tests Petr Horáček: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Edward Haas: Verified -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Dan Kenigsberg has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Petr Horáček has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 4: Code-Review+1 (1 comment) https://gerrit.ovirt.org/#/c/63990/4/lib/vdsm/network/configurators/ifcfg.py File lib/vdsm/network/configurators/ifcfg.py: Line 236: DynamicSourceRoute.addInterfaceTracking(netEnt) Line 237: Line 238: def removeBond(self, bonding): Line 239: if not self.owned_device(bonding.name): Line 240: self.normalize_device_filename(bonding.name) > As far as I know, network caps is generated from actual kernel settings, an For networks I guess it would be somehow 'emergency' removed. Not sure about bonds. I can't imagine a situation where would the additional check hurt. Line 241: to_be_removed = self._ifaceDownAndCleanup(bonding) Line 242: if to_be_removed: Line 243: self.configApplier.removeBonding(bonding.name) Line 244: if bonding.on_removal_just_detach_from_network: -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Edward Haas has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 4: (2 comments) https://gerrit.ovirt.org/#/c/63990/4/lib/vdsm/network/configurators/ifcfg.py File lib/vdsm/network/configurators/ifcfg.py: Line 236: DynamicSourceRoute.addInterfaceTracking(netEnt) Line 237: Line 238: def removeBond(self, bonding): Line 239: if not self.owned_device(bonding.name): Line 240: self.normalize_device_filename(bonding.name) > do we need to handle removals and editations? if we acquired iface in confi As far as I know, network caps is generated from actual kernel settings, and not ifcfg. Therefore, a command to remove a device (bond is a good example) may arrive without vdsm owning it yet. (Unless we somewhere check that it is not in running/persistent config before actually doing this). Do we have something that blocks vdsm from removing a bond created by the user before the host was added? Line 241: to_be_removed = self._ifaceDownAndCleanup(bonding) Line 242: if to_be_removed: Line 243: self.configApplier.removeBonding(bonding.name) Line 244: if bonding.on_removal_just_detach_from_network: https://gerrit.ovirt.org/#/c/63990/4/tests/network/func_net_basic_test.py File tests/network/func_net_basic_test.py: Line 71: class NetworkBasicLegacyTest(NetworkBasicTemplate): Line 72: __test__ = True Line 73: switch = 'legacy' Line 74: Line 75: def test_add_net_based_on_device_with_non_standard_ifcfg_file(self): > please add a TODO, we need this also for ifacquire (OVS) We should open an internal ticker for this. It's an ifacquire module test "todo", it makes no sense to add it here. Line 76: with dummy_device() as nic: Line 77: NETCREATE = {NETWORK_NAME: {'nic': nic, 'switch': self.switch}} Line 78: NETREMOVE = {NETWORK_NAME: {'remove': True}} Line 79: with self.setupNetworks(NETCREATE, {}, NOCHK): -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Petr Horáček has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 4: Code-Review-1 (2 comments) https://gerrit.ovirt.org/#/c/63990/4/lib/vdsm/network/configurators/ifcfg.py File lib/vdsm/network/configurators/ifcfg.py: Line 236: DynamicSourceRoute.addInterfaceTracking(netEnt) Line 237: Line 238: def removeBond(self, bonding): Line 239: if not self.owned_device(bonding.name): Line 240: self.normalize_device_filename(bonding.name) do we need to handle removals and editations? if we acquired iface in configure*, it must be already renamed. Line 241: to_be_removed = self._ifaceDownAndCleanup(bonding) Line 242: if to_be_removed: Line 243: self.configApplier.removeBonding(bonding.name) Line 244: if bonding.on_removal_just_detach_from_network: https://gerrit.ovirt.org/#/c/63990/4/tests/network/func_net_basic_test.py File tests/network/func_net_basic_test.py: Line 71: class NetworkBasicLegacyTest(NetworkBasicTemplate): Line 72: __test__ = True Line 73: switch = 'legacy' Line 74: Line 75: def test_add_net_based_on_device_with_non_standard_ifcfg_file(self): please add a TODO, we need this also for ifacquire (OVS) Line 76: with dummy_device() as nic: Line 77: NETCREATE = {NETWORK_NAME: {'nic': nic, 'switch': self.switch}} Line 78: NETREMOVE = {NETWORK_NAME: {'remove': True}} Line 79: with self.setupNetworks(NETCREATE, {}, NOCHK): -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
gerrit-hooks has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 4: * #1367378::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1367378::OK, public bug * Check Product::#1367378::OK, Correct classification oVirt * Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Edward Haas has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 3: Verified+1 Func tests passed and checked by QE -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
gerrit-hooks has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 3: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Michael Burman Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
gerrit-hooks has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 2: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Petr Horáček has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 1: -Code-Review (1 comment) https://gerrit.ovirt.org/#/c/63990/1//COMMIT_MSG Commit Message: Line 12: If the host is set initially by Network Manager, the names of the files Line 13: do no correspond to the expected format. Line 14: Line 15: This patch adjusts the ifcfg file name to the mentioned format and Line 16: erases any other ifcfg files that correspond to the same device. > Perhaps I should elaborate more in the commit message. Ifcfg files support multiple connection definitions per iface, even without NM. I'm a bit afraid this cleanup can scare some users, but maybe it will be alright. However, if we we don't want to be friendly to NM and do not support multiple ifcfgs per iface in VDSM, this should be good. Line 17: Line 18: Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Line 19: TODO: Add functional tests. -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Edward Haas has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 1: (1 comment) https://gerrit.ovirt.org/#/c/63990/1//COMMIT_MSG Commit Message: Line 12: If the host is set initially by Network Manager, the names of the files Line 13: do no correspond to the expected format. Line 14: Line 15: This patch adjusts the ifcfg file name to the mentioned format and Line 16: erases any other ifcfg files that correspond to the same device. > Maybe AUTOCONNECT_PRIORITY in `man nm-settings-ifcfg-rh` would help. Perhaps I should elaborate more in the commit message. It is not meant to be NM friendly, it is aimed to 'fix' NM ifcfg files so VDSM can consume it. NM is disabled already. As far as I know, it is not valid to have multiple ifcfg files using the same device with VDSM. And I think only NM can work with multiple ifcfg files as part of the 'connection' definition. Line 17: Line 18: Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Line 19: TODO: Add functional tests. -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Petr Horáček has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 1: (1 comment) https://gerrit.ovirt.org/#/c/63990/1//COMMIT_MSG Commit Message: Line 12: If the host is set initially by Network Manager, the names of the files Line 13: do no correspond to the expected format. Line 14: Line 15: This patch adjusts the ifcfg file name to the mentioned format and Line 16: erases any other ifcfg files that correspond to the same device. > that is not really NM friendly. it is valid to have multiple configurations Maybe AUTOCONNECT_PRIORITY in `man nm-settings-ifcfg-rh` would help. Line 17: Line 18: Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Line 19: TODO: Add functional tests. -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Petr Horáček has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 1: Code-Review-1 (1 comment) https://gerrit.ovirt.org/#/c/63990/1//COMMIT_MSG Commit Message: Line 12: If the host is set initially by Network Manager, the names of the files Line 13: do no correspond to the expected format. Line 14: Line 15: This patch adjusts the ifcfg file name to the mentioned format and Line 16: erases any other ifcfg files that correspond to the same device. that is not really NM friendly. it is valid to have multiple configurations per on iface, even without NM. is there PRIORITY parameter available for ifcfg files? if there is, won't be better to set big big big number as priority for VDSM ifcfg files? Line 17: Line 18: Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Line 19: TODO: Add functional tests. -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
gerrit-hooks has posted comments on this change. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. Patch Set 1: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63990 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Consume ifcfg files that have a non vdsm standard name
Edward Haas has uploaded a new change for review. Change subject: net: Consume ifcfg files that have a non vdsm standard name .. net: Consume ifcfg files that have a non vdsm standard name VDSM assumes that the ifcfg files which represent network devices are named in the following format: ifcfg- If the host is set initially by Network Manager, the names of the files do no correspond to the expected format. This patch adjusts the ifcfg file name to the mentioned format and erases any other ifcfg files that correspond to the same device. Change-Id: I0bf70ba936d5de1f17a90742644719216018f674 TODO: Add functional tests. Signed-off-by: Edward Haas--- M lib/vdsm/network/configurators/ifcfg.py 1 file changed, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/63990/1 diff --git a/lib/vdsm/network/configurators/ifcfg.py b/lib/vdsm/network/configurators/ifcfg.py index 8eb681e..feefc53 100644 --- a/lib/vdsm/network/configurators/ifcfg.py +++ b/lib/vdsm/network/configurators/ifcfg.py @@ -108,6 +108,8 @@ self.runningConfig = None def configureBridge(self, bridge, **opts): +if not self.owned_device(bridge.name): +self.normalize_device_filename(bridge.name) self.configApplier.addBridge(bridge, **opts) ifdown(bridge.name) if bridge.port: @@ -116,12 +118,16 @@ _ifup(bridge) def configureVlan(self, vlan, **opts): +if not self.owned_device(vlan.name): +self.normalize_device_filename(vlan.name) self.configApplier.addVlan(vlan, **opts) vlan.device.configure(**opts) self._addSourceRoute(vlan) _ifup(vlan) def configureBond(self, bond, **opts): +if not self.owned_device(bond.name): +self.normalize_device_filename(bond.name) self.configApplier.addBonding(bond, **opts) if not vlans.is_vlanned(bond.name): for slave in bond.slaves: @@ -145,6 +151,9 @@ nicsToSet = frozenset(nic.name for nic in bond.slaves) currentNics = frozenset(_netinfo.getNicsForBonding(bond.name)) nicsToAdd = nicsToSet - currentNics + +if not self.owned_device(bond.name): +self.normalize_device_filename(bond.name) # Create bond configuration in case it was a non ifcfg controlled bond. # Needed to be before slave configuration for initscripts to add slave @@ -183,6 +192,8 @@ 'switch': 'legacy'}) def configureNic(self, nic, **opts): +if not self.owned_device(nic.name): +self.normalize_device_filename(nic.name) self.configApplier.addNic(nic, **opts) self._addSourceRoute(nic) if nic.bond is None: @@ -191,6 +202,8 @@ _ifup(nic) def removeBridge(self, bridge): +if not self.owned_device(bridge.name): +self.normalize_device_filename(bridge.name) DynamicSourceRoute.addInterfaceTracking(bridge) ifdown(bridge.name) self._removeSourceRoute(bridge, StaticSourceRoute) @@ -200,6 +213,8 @@ bridge.port.remove() def removeVlan(self, vlan): +if not self.owned_device(vlan.name): +self.normalize_device_filename(vlan.name) DynamicSourceRoute.addInterfaceTracking(vlan) ifdown(vlan.name) self._removeSourceRoute(vlan, StaticSourceRoute) @@ -221,6 +236,8 @@ DynamicSourceRoute.addInterfaceTracking(netEnt) def removeBond(self, bonding): +if not self.owned_device(bonding.name): +self.normalize_device_filename(bonding.name) to_be_removed = self._ifaceDownAndCleanup(bonding) if to_be_removed: self.configApplier.removeBonding(bonding.name) @@ -245,6 +262,8 @@ ipwrapper.linkSet(bonding.name, ['mtu', str(set_mtu)]) def removeNic(self, nic, remove_even_if_used=False): +if not self.owned_device(nic.name): +self.normalize_device_filename(nic.name) to_be_removed = self._ifaceDownAndCleanup(nic, remove_even_if_used) if to_be_removed: self.configApplier.removeNic(nic.name) @@ -297,6 +316,33 @@ else: return content.startswith(CONFFILE_HEADER_SIGNATURE) +@staticmethod +def normalize_device_filename(device): +""" +Attempts to detect a device ifcfg file and rename it to a vdsm +supported format. +In case of multiple ifcfg files that treat the same device, all except +the first are deleted. +""" +device_files = [] +paths = glob.iglob(NET_CONF_PREF + '*') +for ifcfg_file in paths: +with open(ifcfg_file) as f: +for line in f: +if line.startswith('#'): +continue +