summaryrefslogtreecommitdiff
path: root/src/migration-scripts/openvpn/2-to-3
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-29 22:29:35 +0200
committerGitHub <noreply@github.com>2024-07-29 22:29:35 +0200
commitad0acad65051a449432f882edb60246cdfeeb8e5 (patch)
tree6fbcb396df88744e539eae75e56bb0835428fa65 /src/migration-scripts/openvpn/2-to-3
parent7724a5f58b515fbc094b4f211d455c1bd5071a74 (diff)
parent30111fa493c72e7182854f295bc88d9eecccf419 (diff)
downloadvyos-1x-ad0acad65051a449432f882edb60246cdfeeb8e5.tar.gz
vyos-1x-ad0acad65051a449432f882edb60246cdfeeb8e5.zip
Merge pull request #3898 from dmbaturin/T6620
vyos.configtree: T6620: allow list_nodes() to work on non-existent paths
Diffstat (limited to 'src/migration-scripts/openvpn/2-to-3')
-rw-r--r--src/migration-scripts/openvpn/2-to-38
1 files changed, 2 insertions, 6 deletions
diff --git a/src/migration-scripts/openvpn/2-to-3 b/src/migration-scripts/openvpn/2-to-3
index 0b9073ae6..4e6b3c8b7 100644
--- a/src/migration-scripts/openvpn/2-to-3
+++ b/src/migration-scripts/openvpn/2-to-3
@@ -20,12 +20,8 @@
from vyos.configtree import ConfigTree
def migrate(config: ConfigTree) -> None:
- if not config.exists(['interfaces', 'openvpn']):
- # Nothing to do
- return
-
- ovpn_intfs = config.list_nodes(['interfaces', 'openvpn'])
- for i in ovpn_intfs:
+ ovpn_intfs = config.list_nodes(['interfaces', 'openvpn'], path_must_exist=False)
+ for i in ovpn_intfs:
mode = config.return_value(['interfaces', 'openvpn', i, 'mode'])
if mode != 'server':
# If it's a client or a site-to-site OpenVPN interface,