summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-12-07 19:53:53 -0600
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-12-08 06:36:19 +0000
commite14c6ca24f2eda229ca4c83190fd02ac90cdabd9 (patch)
tree16d55047df18edb456d5b1bb8665ae32812fbd69 /src
parentd79b4b143c9d167a8210976b807b6eb996ace6d3 (diff)
downloadvyos-1x-e14c6ca24f2eda229ca4c83190fd02ac90cdabd9.tar.gz
vyos-1x-e14c6ca24f2eda229ca4c83190fd02ac90cdabd9.zip
wireguard: T5413: fix missing check to migration script raising error
(cherry picked from commit 237b71a89160f28e5c603bacf707b1c235f01026)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/migration-scripts/interfaces/29-to-3011
1 files changed, 7 insertions, 4 deletions
diff --git a/src/migration-scripts/interfaces/29-to-30 b/src/migration-scripts/interfaces/29-to-30
index 97e1b329c..04e023e77 100755
--- a/src/migration-scripts/interfaces/29-to-30
+++ b/src/migration-scripts/interfaces/29-to-30
@@ -35,16 +35,19 @@ if __name__ == '__main__':
# Nothing to do
sys.exit(0)
for interface in config.list_nodes(base):
+ if not config.exists(base + [interface, 'private-key']):
+ continue
private_key = config.return_value(base + [interface, 'private-key'])
interface_base = base + [interface]
if config.exists(interface_base + ['peer']):
for peer in config.list_nodes(interface_base + ['peer']):
peer_base = interface_base + ['peer', peer]
+ if not config.exists(peer_base + ['public-key']):
+ continue
peer_public_key = config.return_value(peer_base + ['public-key'])
- if config.exists(peer_base + ['public-key']):
- if not config.exists(peer_base + ['disable']) \
- and is_wireguard_key_pair(private_key, peer_public_key):
- config.set(peer_base + ['disable'])
+ if not config.exists(peer_base + ['disable']) \
+ and is_wireguard_key_pair(private_key, peer_public_key):
+ config.set(peer_base + ['disable'])
try:
with open(file_name, 'w') as f: