Skip to content

Commit

Permalink
[qos] _validate_create_network_callback return in no network
Browse files Browse the repository at this point in the history
It seems that _validate_create_network_callback notified without
network_id in payload, to avoid issues in such case return.

Change-Id: I15d22e0e2b4bf3e4f882b521bcd6a13f84e4feed
Closes-Bug: #2008912
(cherry picked from commit ec4bfb9)
  • Loading branch information
elajkat authored and ralonsoh committed Jun 26, 2023
1 parent 9e77802 commit f1d7dbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neutron/services/qos/qos_plugin.py
Expand Up @@ -602,9 +602,9 @@ def _validate_create_network_callback(self, resource, event, trigger,
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)
Expand Down

0 comments on commit f1d7dbc

Please sign in to comment.