Skip to content
Snippets Groups Projects
Commit 784d714a authored by David Baker's avatar David Baker
Browse files

Fix server default rule injection (downwards, not upwards!)

parent ecb0f780
No related branches found
No related tags found
No related merge requests found
......@@ -4,24 +4,24 @@ def list_with_base_rules(rawrules, user_name):
ruleslist = []
# shove the server default rules for each kind onto the end of each
current_prio_class = 1
current_prio_class = PRIORITY_CLASS_INVERSE_MAP.keys()[-1]
for r in rawrules:
if r['priority_class'] > current_prio_class:
while current_prio_class < r['priority_class']:
if r['priority_class'] < current_prio_class:
while r['priority_class'] < current_prio_class:
ruleslist.extend(make_base_rules(
user_name,
PRIORITY_CLASS_INVERSE_MAP[current_prio_class])
)
current_prio_class += 1
current_prio_class -= 1
ruleslist.append(r)
while current_prio_class <= PRIORITY_CLASS_INVERSE_MAP.keys()[-1]:
while current_prio_class > 0:
ruleslist.extend(make_base_rules(
user_name,
PRIORITY_CLASS_INVERSE_MAP[current_prio_class])
)
current_prio_class += 1
current_prio_class -= 1
return ruleslist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment