Gracefully handle fetch network fail in qos extend port
When the qos plugin is handling a port resource request through it's port resource request extension, sometimes the network a port is attached to is looked up and returns None. It may happen like that if network will be deleted in concurrent API request. Change-Id: Ide4acdf4c373713968f9d43274fb0c7550283c11 Closes-Bug: #1810504
This commit is contained in:
parent
284afcf24f
commit
65a2f86aaf
@ -99,7 +99,7 @@ class QoSPlugin(qos.QoSPluginBase):
|
||||
if not qos_policy:
|
||||
net = network_object.Network.get_object(
|
||||
context.get_admin_context(), id=port_res['network_id'])
|
||||
if net.qos_policy_id:
|
||||
if net and net.qos_policy_id:
|
||||
qos_policy = policy_object.QosPolicy.get_network_policy(
|
||||
context.get_admin_context(), net.id)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user