heal_and_optimize flow retrieves a list of vifs
using a method in util module. For SR-IOV agent,
_find_vifs methid is invoked, it is common to CNA
and VNIC objects. The vswitch_id is retrieved and
validated, since vswitch_id is not present in VNIC
object, getattr call fails. Since this method is
common to both CNA and VNIC, a default return value
of None should be included in the list of parameters.
networking_powervm/plugins/ibm/agent/powervm/util.py
_find_vifs method :
Instead of getattr(vif, 'vswitch_id')
getattr(vif, 'vswitch_id', None) should be used.
Reviewed: https:/ /review. openstack. org/465761 /git.openstack. org/cgit/ openstack/ networking- powervm/ commit/ ?id=ace8c0ef0dd 67de8884ed3ccda 055b1363fc2db8
Committed: https:/
Submitter: Jenkins
Branch: master
commit ace8c0ef0dd67de 8884ed3ccda055b 1363fc2db8
Author: Sridhar Venkat <email address hidden>
Date: Wed May 17 19:04:27 2017 -0400
Heal and optimize fails to retrieve vifs.
heal_ and_optimize flow retrieves a list of vifs
using a method in util module. For SR-IOV agent,
_find_vifs methid is invoked, it is common to CNA
and VNIC objects. The vswitch_id is retrieved and
validated, since vswitch_id is not present in VNIC
object, getattr call fails. Since this method is
common to both CNA and VNIC, a default return value
of None should be included in the list of parameters.
networking_ powervm/ plugins/ ibm/agent/ powervm/ util.py
_find_vifs method :
Instead of getattr(vif, 'vswitch_id')
getattr(vif, 'vswitch_id', None) should be used.
Change-Id: I38f1662801ad77 3408ab581c77161 677b1cb6b36
Closes-Bug: #1691584