summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/migration-scripts/firewall/12-to-132
-rwxr-xr-xsrc/migration-scripts/policy/6-to-72
-rwxr-xr-xsrc/op_mode/generate_firewall_rule-resequence.py4
3 files changed, 6 insertions, 2 deletions
diff --git a/src/migration-scripts/firewall/12-to-13 b/src/migration-scripts/firewall/12-to-13
index c2b34b2d8..4eaae779b 100755
--- a/src/migration-scripts/firewall/12-to-13
+++ b/src/migration-scripts/firewall/12-to-13
@@ -70,7 +70,7 @@ for family in ['ipv4', 'ipv6', 'bridge']:
state_value = config.return_value(base + [family, hook, priority, 'rule', rule, 'state', state])
config.delete(base + [family, hook, priority, 'rule', rule, 'state', state])
if state_value == 'enable':
- config.set(base + [family, hook, priority, 'rule', rule, 'state', state])
+ config.set(base + [family, hook, priority, 'rule', rule, 'state'], value=state, replace=False)
flag_enable = 'True'
if flag_enable == 'False':
config.delete(base + [family, hook, priority, 'rule', rule, 'state'])
diff --git a/src/migration-scripts/policy/6-to-7 b/src/migration-scripts/policy/6-to-7
index 1f955aa02..727b8487a 100755
--- a/src/migration-scripts/policy/6-to-7
+++ b/src/migration-scripts/policy/6-to-7
@@ -66,7 +66,7 @@ for family in ['route', 'route6']:
state_value = config.return_value(base + [family, policy_name, 'rule', rule, 'state', state])
config.delete(base + [family, policy_name, 'rule', rule, 'state', state])
if state_value == 'enable':
- config.set(base + [family, policy_name, 'rule', rule, 'state', state])
+ config.set(base + [family, policy_name, 'rule', rule, 'state'], value=state, replace=False)
flag_enable = 'True'
if flag_enable == 'False':
config.delete(base + [family, policy_name, 'rule', rule, 'state'])
diff --git a/src/op_mode/generate_firewall_rule-resequence.py b/src/op_mode/generate_firewall_rule-resequence.py
index eb82a1a0a..21441f689 100755
--- a/src/op_mode/generate_firewall_rule-resequence.py
+++ b/src/op_mode/generate_firewall_rule-resequence.py
@@ -41,6 +41,10 @@ def convert_to_set_commands(config_dict, parent_key=''):
commands.extend(
convert_to_set_commands(value, f"{current_key} "))
+ elif isinstance(value, list):
+ for item in value:
+ commands.append(f"set {current_key} '{item}'")
+
elif isinstance(value, str):
commands.append(f"set {current_key} '{value}'")