Change in vdsm[master]: net: factor out _find_bonds_with_available_nics
Dan Kenigsberg has submitted this change and it was merged. Change subject: net: factor out _find_bonds_with_available_nics .. net: factor out _find_bonds_with_available_nics Aiming to break _filter_nets_bonds apart so it will be simpler and easier to read. Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Signed-off-by: Ido Barkan Reviewed-on: https://gerrit.ovirt.org/40539 Reviewed-by: Ondřej Svoboda Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg --- M vdsm/vdsm-restore-net-config 1 file changed, 14 insertions(+), 7 deletions(-) Approvals: Ido Barkan: Verified Ondřej Svoboda: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Gerrit-PatchSet: 4 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: automat...@ovirt.org ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: net: factor out _find_bonds_with_available_nics
automat...@ovirt.org has posted comments on this change. Change subject: net: factor out _find_bonds_with_available_nics .. Patch Set 4: * Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found. -- To view, visit https://gerrit.ovirt.org/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Gerrit-PatchSet: 4 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: 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]: net: factor out _find_bonds_with_available_nics
Dan Kenigsberg has posted comments on this change. Change subject: net: factor out _find_bonds_with_available_nics .. Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.ovirt.org/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 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: 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]: net: factor out _find_bonds_with_available_nics
Ido Barkan has posted comments on this change. Change subject: net: factor out _find_bonds_with_available_nics .. Patch Set 3: Verified+1 -- To view, visit https://gerrit.ovirt.org/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Gerrit-PatchSet: 3 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: 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]: net: factor out _find_bonds_with_available_nics
automat...@ovirt.org has posted comments on this change. Change subject: net: factor out _find_bonds_with_available_nics .. 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.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda 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]: net: factor out _find_bonds_with_available_nics
automat...@ovirt.org has posted comments on this change. Change subject: net: factor out _find_bonds_with_available_nics .. 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/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda 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]: net: factor out _find_bonds_with_available_nics
Ondřej Svoboda has posted comments on this change. Change subject: net: factor out _find_bonds_with_available_nics .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda 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]: net: factor out _find_bonds_with_available_nics
Ido Barkan has uploaded a new change for review. Change subject: net: factor out _find_bonds_with_available_nics .. net: factor out _find_bonds_with_available_nics Aiming to break _filter_nets_bonds apart so it will be simpler and easier to read. Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 Signed-off-by: Ido Barkan --- M vdsm/vdsm-restore-net-config 1 file changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/40539/1 diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config index eb19a1a..6f0f195 100755 --- a/vdsm/vdsm-restore-net-config +++ b/vdsm/vdsm-restore-net-config @@ -116,14 +116,10 @@ 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_nets = {} available_nics = netinfo.nics() -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 +available_bonds = _find_bonds_with_available_nics(available_nics, + persisted_bonds) for net, attrs in persisted_nets.iteritems(): bond = attrs.get('bonding') @@ -155,6 +151,17 @@ return available_nets, available_bonds +def _find_bonds_with_available_nics(available_nics, persisted_bonds): +available_bonds = {} +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 +return available_bonds + + def _get_all_configurators(): """Returns the class objects of all the configurators in the netconf pkg""" prefix = configurators.__name__ + '.' -- To view, visit https://gerrit.ovirt.org/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 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]: net: factor out _find_bonds_with_available_nics
automat...@ovirt.org has posted comments on this change. Change subject: net: factor out _find_bonds_with_available_nics .. 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/40539 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09dc7278607b3f908a82ec1c523052c79e6269c8 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