summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-03 16:32:24 +0200
committerGitHub <noreply@github.com>2024-07-03 16:32:24 +0200
commitd6a332a1f3218ef589e1c724dd4d728e03798925 (patch)
tree5f89454fb93a2dcc859b3a5fbdecc7ed272d6e8a
parentd0bc944526c0c3905fb8bdcf602538465e7d27de (diff)
parent66ec278393dbabe71f320c543816f27797d51140 (diff)
downloadvyos-1x-d6a332a1f3218ef589e1c724dd4d728e03798925.tar.gz
vyos-1x-d6a332a1f3218ef589e1c724dd4d728e03798925.zip
Merge pull request #3749 from nicolas-fort/T6536-wildcard
T6536: nat: add migration script that replaces wildcard charater
-rw-r--r--src/migration-scripts/firewall/7-to-88
-rw-r--r--src/migration-scripts/nat/6-to-72
2 files changed, 9 insertions, 1 deletions
diff --git a/src/migration-scripts/firewall/7-to-8 b/src/migration-scripts/firewall/7-to-8
index f46994ce2..b8bcc52cc 100644
--- a/src/migration-scripts/firewall/7-to-8
+++ b/src/migration-scripts/firewall/7-to-8
@@ -71,5 +71,11 @@ def migrate(config: ConfigTree) -> None:
config.set_tag(['firewall', 'zone'])
for zone in config.list_nodes(zone_base + ['zone']):
+ if 'interface' in config.list_nodes(zone_base + ['zone', zone]):
+ for iface in config.return_values(zone_base + ['zone', zone, 'interface']):
+ if '+' in iface:
+ config.delete_value(zone_base + ['zone', zone, 'interface'], value=iface)
+ iface = iface.replace('+', '*')
+ config.set(zone_base + ['zone', zone, 'interface'], value=iface, replace=False)
config.copy(zone_base + ['zone', zone], ['firewall', 'zone', zone])
- config.delete(zone_base)
+ config.delete(zone_base) \ No newline at end of file
diff --git a/src/migration-scripts/nat/6-to-7 b/src/migration-scripts/nat/6-to-7
index 81b413e36..e9b90fc98 100644
--- a/src/migration-scripts/nat/6-to-7
+++ b/src/migration-scripts/nat/6-to-7
@@ -47,6 +47,8 @@ def migrate(config: ConfigTree) -> None:
tmp = config.return_value(base + [iface, 'interface-name'])
if tmp != 'any':
config.delete(base + [iface, 'interface-name'])
+ if '+' in tmp:
+ tmp = tmp.replace('+', '*')
config.set(base + [iface, 'name'], value=tmp)
else:
config.delete(base + [iface])