diff options
author | Daniil Baturin <daniil@vyos.io> | 2021-09-26 10:11:23 -0500 |
---|---|---|
committer | Daniil Baturin <daniil@vyos.io> | 2021-09-26 10:11:23 -0500 |
commit | cf05add82e5469c9befefd6b52936c6b2fedda88 (patch) | |
tree | ef0cc5beddc5d67638bacef4e194e97d1de2f743 /src/migration-scripts | |
parent | 579c64f5ab5c6bc140f72045ca243fa3f2134ba3 (diff) | |
download | vyos-1x-cf05add82e5469c9befefd6b52936c6b2fedda88.tar.gz vyos-1x-cf05add82e5469c9befefd6b52936c6b2fedda88.zip |
T3866: ignore interfaces without "address" in DNS forwarding migration
Diffstat (limited to 'src/migration-scripts')
-rwxr-xr-x | src/migration-scripts/dns-forwarding/1-to-2 | 10 |
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) |