Change in vdsm[master]: network: factor out method from unified restoration logic.
Dan Kenigsberg has submitted this change and it was merged. Change subject: network: factor out method from unified restoration logic. .. network: factor out method from unified restoration logic. Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Signed-off-by: Ido Barkan Reviewed-on: https://gerrit.ovirt.org/40536 Reviewed-by: Ondřej Svoboda Reviewed-by: Dan Kenigsberg Continuous-Integration: Dan Kenigsberg --- M vdsm/vdsm-restore-net-config 1 file changed, 29 insertions(+), 17 deletions(-) Approvals: Ido Barkan: Verified Ondřej Svoboda: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved; Passed CI tests -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
automat...@ovirt.org has posted comments on this change. Change subject: network: factor out method from unified restoration logic. .. Patch Set 3: * Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found. -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
Dan Kenigsberg has posted comments on this change. Change subject: network: factor out method from unified restoration logic. .. Patch Set 2: Continuous-Integration+1 -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
Dan Kenigsberg has posted comments on this change. Change subject: network: factor out method from unified restoration logic. .. Patch Set 2: Code-Review+2 replacing a comment with a function is noble. -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
Ido Barkan has posted comments on this change. Change subject: network: factor out method from unified restoration logic. .. Patch Set 2: Verified+1 -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
automat...@ovirt.org has posted comments on this change. Change subject: network: factor out method from unified restoration logic. .. 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.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
Ondřej Svoboda has posted comments on this change. Change subject: network: factor out method from unified restoration logic. .. Patch Set 1: Code-Review+1 Nice :-) -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
Ido Barkan has uploaded a new change for review. Change subject: network: factor out method from unified restoration logic. .. network: factor out method from unified restoration logic. Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Signed-off-by: Ido Barkan --- M vdsm/vdsm-restore-net-config 1 file changed, 29 insertions(+), 17 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/40536/1 diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config index 4834d7e..0c60732 100755 --- a/vdsm/vdsm-restore-net-config +++ b/vdsm/vdsm-restore-net-config @@ -51,6 +51,23 @@ Builds a setupNetworks command from the persistent configuration to set it as running configuration. """ +_remove_networks_in_running_config() + +_flush_configurators_leftovers() + +_restore_non_vdsm_net_devices() + +persistentConfig = PersistentConfig() +nets, bonds = _filter_nets_bonds(persistentConfig.networks, + persistentConfig.bonds) +if nets or bonds: +_convert_to_blocking_dhcp(nets) +logging.debug('Calling setupNetworks with networks (%s) ' + 'and bond (%s).', nets, bonds) +setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True) + + +def _remove_networks_in_running_config(): runningConfig = RunningConfig() removeNetworks = {} removeBonds = {} @@ -64,23 +81,18 @@ setupNetworks(removeNetworks, removeBonds, connectivityCheck=False, _inRollback=True) -# Flush vdsm configurations left-overs from any configurator on the system -# so that changes of configurator and persistence system are smooth. + +def _flush_configurators_leftovers(): +"""Flush vdsm configurations left-overs from any configurator on the system +so that changes of configurator and persistence system are smooth.""" for configurator_cls in _get_all_configurators(): configurator_cls().flush() -# Restore non-VDSM network devices (BZ#1188251) + +def _restore_non_vdsm_net_devices(): +# addresses (BZ#1188251) configWriter = ifcfg.ConfigWriter() configWriter.restorePersistentBackup() - -persistentConfig = PersistentConfig() -nets, bonds = _filter_nets_bonds(persistentConfig.networks, - persistentConfig.bonds) -if nets or bonds: -_convert_to_blocking_dhcp(nets) -logging.debug('Calling setupNetworks with networks (%s) ' - 'and bond (%s).', nets, bonds) -setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True) def _convert_to_blocking_dhcp(networks): @@ -98,22 +110,22 @@ net_attr['blockingdhcp'] = True -def _filter_nets_bonds(nets, bonds): +def _filter_nets_bonds(persisted_nets, persisted_bonds): """Returns only nets and bonds that can be configured with the devices present in the system""" available_nets, available_bonds = {}, {} available_nics = netinfo.nics() -for bond, attrs in bonds.iteritems(): +for bond, attrs in persisted_bonds.iteritems(): available_bond_nics = [nic for nic in attrs['nics'] if nic in available_nics] if available_bond_nics: available_bonds[bond] = attrs.copy() available_bonds[bond]['nics'] = available_bond_nics -for net, attrs in nets.iteritems(): +for net, attrs in persisted_nets.iteritems(): bond = attrs.get('bonding') if bond is not None: -if bond not in bonds: +if bond not in persisted_bonds: logging.error('Bond "%s" is not configured. ' 'Network "%s" will not be ' 'configured as a consequence', bond, net) @@ -121,7 +133,7 @@ logging.error('Some of the nics required by bond "%s" (%s) ' 'are missing. Network "%s" will not be ' 'configured as a consequence', bond, - bonds[bond]['nics'], net) + persisted_bonds[bond]['nics'], net) else: available_nets[net] = attrs continue # Regardless of availability, the net is processed -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: network: factor out method from unified restoration logic.
automat...@ovirt.org has posted comments on this change. Change subject: network: factor out method from unified restoration logic. .. 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.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/40536 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecc95718ac1755799884c7b124a83238e8a5f27d Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches