Merge "Do not query the DB if QoS policy ID is None"

This commit is contained in:
Zuul 2021-01-09 21:38:36 +00:00 committed by Gerrit Code Review
commit 9f9c6f8d8f
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,9 @@ DSCP_MARK = 'dscp_mark'
def get_rules(obj_cls, context, qos_policy_id):
all_rules = []
if not qos_policy_id:
return all_rules
with obj_cls.db_context_reader(context):
for rule_type in qos_consts.VALID_RULE_TYPES:
rule_cls_name = 'Qos%sRule' % helpers.camelize(rule_type)