Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
netinfo: Drop ifcfg reading from _getNetInfo
For backwards compatibility we need to report the bridge 'cfg' field in the network attributes dictionary. Up until now, this was done by re-reading the 'ifcfg' files of the bridge. After this change, we will just be adding the 'cfg' field that we already generated for the bridge device.
Note that 'BOOTPROTO' reporting is already part of _devinfo, so we don't need that part.
Change-Id: I2a80251cc45792ba5511d22bce9451fb3b36689d Signed-off-by: Antoni S. Puimedon asegurap@redhat.com --- M lib/vdsm/netinfo.py 1 file changed, 5 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/35012/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py index d2ef90b..20eadbe 100644 --- a/lib/vdsm/netinfo.py +++ b/lib/vdsm/netinfo.py @@ -448,8 +448,8 @@ data = {} try: if bridged: - data.update({'ports': ports(iface), 'stp': bridge_stp_state(iface), - 'cfg': getIfaceCfg(iface)}) + data.update({'ports': ports(iface), + 'stp': bridge_stp_state(iface)}) else: # ovirt-engine-3.1 expects to see the "interface" attribute iff the # network is bridgeless. Please remove the attribute and this @@ -647,13 +647,6 @@ return d
-def _cfgBootprotoCompat(networks): - """Set network 'cfg' 'BOOTPROTO' for backwards engine compatibility.""" - for netAttrs in networks.itervalues(): - if netAttrs['bridged'] and 'BOOTPROTO' not in netAttrs['cfg']: - netAttrs['cfg']['BOOTPROTO'] = netAttrs['bootproto4'] - - def get(vdsmnets=None): d = {'bondings': {}, 'bridges': {}, 'networks': {}, 'nics': {}, 'vlans': {}} @@ -683,7 +676,9 @@ if dev.isBOND(): _bondOptsCompat(devinfo)
- _cfgBootprotoCompat(d['networks']) + for net, attrs in d['networks']: + if attrs['bridged']: + attrs['cfg'] = d['bridges'][net]['cfg']
return d
Dan Kenigsberg has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 2: Code-Review+1
oVirt Jenkins CI Server has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 1:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/13468/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/13307/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/12517/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_network_functional_tests_gerrit/216... : There was an infra issue, please contact infra@ovirt.org
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/80/ : FAILURE
oVirt Jenkins CI Server has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 2:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/13469/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/13308/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/12518/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_network_functional_tests_gerrit/216... : There was an infra issue, please contact infra@ovirt.org
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/81/ : FAILURE
automation@ovirt.org has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
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'])
Ido Barkan has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 3: Verified+1
Dan Kenigsberg has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 3:
(1 comment)
https://gerrit.ovirt.org/#/c/35012/3/vdsm/network/api.py File vdsm/network/api.py:
Line 877: _delNetwork(network, configurator=configurator, force=force, Line 878: implicitBonding=False, _netinfo=_netinfo, Line 879: keep_bridge=keep_bridge) Line 880: del _netinfo.networks[network] Line 881: _netinfo.updateDevices() Why is this required? Line 882: elif network in libvirt_nets: Line 883: # If the network was not in _netinfo but is in the networks Line 884: # returned by libvirt, it means that we are dealing with Line 885: # a broken network.
Dan Kenigsberg has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 3: Code-Review+2
(1 comment)
https://gerrit.ovirt.org/#/c/35012/3/vdsm/network/api.py File vdsm/network/api.py:
Line 877: _delNetwork(network, configurator=configurator, force=force, Line 878: implicitBonding=False, _netinfo=_netinfo, Line 879: keep_bridge=keep_bridge) Line 880: del _netinfo.networks[network] Line 881: _netinfo.updateDevices()
Why is this required?
because otherwise, updateDevices() woul dattempt to read the recently-deleted network's devices and explode. Line 882: elif network in libvirt_nets: Line 883: # If the network was not in _netinfo but is in the networks Line 884: # returned by libvirt, it means that we are dealing with Line 885: # a broken network.
automation@ovirt.org has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 4:
* 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'])
Dan Kenigsberg has submitted this change and it was merged.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
netinfo: Drop ifcfg reading from _getNetInfo
For backwards compatibility we need to report the bridge 'cfg' field in the network attributes dictionary. Up until now, this was done by re-reading the 'ifcfg' files of the bridge. After this change, we will just be adding the 'cfg' field that we already generated for the bridge device.
Note that 'BOOTPROTO' reporting is already part of _devinfo, so we don't need that part.
Change-Id: I2a80251cc45792ba5511d22bce9451fb3b36689d Signed-off-by: Antoni S. Puimedon asegurap@redhat.com Signed-off-by: Ido Barkan ibarkan@redhat.com Reviewed-on: https://gerrit.ovirt.org/35012 Reviewed-by: Dan Kenigsberg danken@redhat.com Continuous-Integration: Jenkins CI --- M lib/vdsm/netinfo.py M vdsm/network/api.py 2 files changed, 6 insertions(+), 11 deletions(-)
Approvals: Ido Barkan: Verified Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved
automation@ovirt.org has posted comments on this change.
Change subject: netinfo: Drop ifcfg reading from _getNetInfo ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org