Skip to content

Commit fbb96b9

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Avoid retrieving ports if network list is empty" into stable/zed
2 parents c91c82f + 9fa3ed4 commit fbb96b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

neutron/services/qos/qos_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def _extend_port_resource_request_bulk(ports_res, noop):
317317
def _get_ports_with_policy(self, context, policy):
318318
networks_ids = policy.get_bound_networks()
319319
ports_with_net_policy = ports_object.Port.get_objects(
320-
context, network_id=networks_ids)
320+
context, network_id=networks_ids) if networks_ids else []
321321

322322
# Filter only this ports which don't have overwritten policy
323323
ports_with_net_policy = [
@@ -327,7 +327,7 @@ def _get_ports_with_policy(self, context, policy):
327327

328328
ports_ids = policy.get_bound_ports()
329329
ports_with_policy = ports_object.Port.get_objects(
330-
context, id=ports_ids)
330+
context, id=ports_ids) if ports_ids else []
331331
return list(set(ports_with_policy + ports_with_net_policy))
332332

333333
def _validate_create_port_callback(self, resource, event, trigger,

0 commit comments

Comments
 (0)