summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-30 08:33:01 +0200
committerGitHub <noreply@github.com>2023-09-30 08:33:01 +0200
commit42a2037dfae8a989fcd12b9d732c635259f0743f (patch)
treeacee9a5f97eb7059d20490b1b68e2f9a7b01718b
parent989ff045aa735bc91ae936aca549e101f6f4d9ed (diff)
parentf39a35338ac967381356f8b9b499ec1d730653fc (diff)
downloadvyos-1x-42a2037dfae8a989fcd12b9d732c635259f0743f.tar.gz
vyos-1x-42a2037dfae8a989fcd12b9d732c635259f0743f.zip
Merge pull request #2323 from JeffWDH/current
T5497: Add ability to resequence rule numbers for firewall
-rwxr-xr-xsrc/op_mode/generate_firewall_rule-resequence.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/op_mode/generate_firewall_rule-resequence.py b/src/op_mode/generate_firewall_rule-resequence.py
index b5b625a80..eb82a1a0a 100755
--- a/src/op_mode/generate_firewall_rule-resequence.py
+++ b/src/op_mode/generate_firewall_rule-resequence.py
@@ -116,9 +116,18 @@ if __name__ == "__main__":
print('Firewall is not configured')
exit(1)
- #config_dict = config.get_config_dict('firewall')
config_dict = config.get_config_dict('firewall')
+ # Remove global-options, group and flowtable as they don't need sequencing
+ if 'global-options' in config_dict['firewall']:
+ del config_dict['firewall']['global-options']
+
+ if 'group' in config_dict['firewall']:
+ del config_dict['firewall']['group']
+
+ if 'flowtable' in config_dict['firewall']:
+ del config_dict['firewall']['flowtable']
+
# Convert rule keys to integers, rule "10" -> rule 10
# This is necessary for sorting the rules
config_dict = convert_rule_keys_to_int(config_dict)