Merge "[qos] _validate_create_network_callback return in no network"

This commit is contained in:
Zuul 2023-06-27 13:10:31 +00:00 committed by Gerrit Code Review
commit fe57eebe8b
1 changed files with 2 additions and 2 deletions

View File

@ -610,9 +610,9 @@ class QoSPlugin(qos.QoSPluginBase):
network_id = payload.resource_id
network = network_object.Network.get_object(context, id=network_id)
policy_id = network.qos_policy_id
if policy_id is None:
if not network or not getattr(network, 'qos_policy_id', None):
return
policy_id = network.qos_policy_id
policy = policy_object.QosPolicy.get_object(
context.elevated(), id=policy_id)