Treat lack of segment info in port object as unbound
A push notifications change added segment information
to the get_device_details() RPC call, but sometimes the
segment information is not present, resulting in an
AttributeError. Just treat the lack of segment info
as if the port was unbound, since the port is probably
in the process of being removed.
Change-Id: I631c6e1f02fa07eed330c99a96aa66d747784f37
Closes-bug: #1714068
(cherry picked from commit 4833852abb
)
This commit is contained in:
parent
8baed13677
commit
42f90203dd
@ -229,6 +229,9 @@ class CacheBackedPluginApi(PluginApi):
|
|||||||
LOG.warning("Device %s is not bound.", port_obj)
|
LOG.warning("Device %s is not bound.", port_obj)
|
||||||
return {'device': device}
|
return {'device': device}
|
||||||
segment = port_obj.binding_levels[-1].segment
|
segment = port_obj.binding_levels[-1].segment
|
||||||
|
if not segment:
|
||||||
|
LOG.debug("Device %s is not bound to any segment.", port_obj)
|
||||||
|
return {'device': device}
|
||||||
net = self.remote_resource_cache.get_resource_by_id(
|
net = self.remote_resource_cache.get_resource_by_id(
|
||||||
resources.NETWORK, port_obj.network_id)
|
resources.NETWORK, port_obj.network_id)
|
||||||
net_qos_policy_id = net.qos_policy_id
|
net_qos_policy_id = net.qos_policy_id
|
||||||
|
Loading…
Reference in New Issue
Block a user