summaryrefslogtreecommitdiff
path: root/src/migration-scripts/dns-forwarding
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2021-09-26 10:11:23 -0500
committerDaniil Baturin <daniil@vyos.io>2021-09-26 10:11:56 -0500
commitaa1362cb4fbb53c6b45e0739b143940f6ec5d85f (patch)
treefa3239998e58a6c6b4e4b668135ee9ac095da8ee /src/migration-scripts/dns-forwarding
parente4812d266ea841f8baf5ad6c7cfae1c7eba664b6 (diff)
downloadvyos-1x-aa1362cb4fbb53c6b45e0739b143940f6ec5d85f.tar.gz
vyos-1x-aa1362cb4fbb53c6b45e0739b143940f6ec5d85f.zip
T3866: ignore interfaces without "address" in DNS forwarding migration
Diffstat (limited to 'src/migration-scripts/dns-forwarding')
-rwxr-xr-xsrc/migration-scripts/dns-forwarding/1-to-210
1 files changed, 8 insertions, 2 deletions
diff --git a/src/migration-scripts/dns-forwarding/1-to-2 b/src/migration-scripts/dns-forwarding/1-to-2
index 8c4f4b5c7..ba10c26f2 100755
--- a/src/migration-scripts/dns-forwarding/1-to-2
+++ b/src/migration-scripts/dns-forwarding/1-to-2
@@ -67,8 +67,14 @@ if config.exists(base + ['listen-on']):
# retrieve corresponding interface addresses in CIDR format
# those need to be converted in pure IP addresses without network information
path = ['interfaces', section, intf, 'address']
- for addr in config.return_values(path):
- listen_addr.append( ip_interface(addr).ip )
+ try:
+ for addr in config.return_values(path):
+ listen_addr.append( ip_interface(addr).ip )
+ except:
+ # Some interface types do not use "address" option (e.g. OpenVPN)
+ # and may not even have a fixed address
+ print("Could not retrieve the address of the interface {} from the config".format(intf))
+ print("You will need to update your DNS forwarding configuration manually")
for addr in listen_addr:
config.set(base + ['listen-address'], value=addr, replace=False)