summaryrefslogtreecommitdiff
path: root/src/migration-scripts/dns-dynamic/1-to-2
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-11-02 20:15:49 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-11-05 10:52:21 -0600
commit50c506a9be56b548a8d461f3e019165c384f49d3 (patch)
tree2650cc25f5ef4d492e2e793eacd97e515cf08277 /src/migration-scripts/dns-dynamic/1-to-2
parentfd5cdaa7a6688eb8ec5c8df26be27253b8ca140f (diff)
downloadvyos-1x-50c506a9be56b548a8d461f3e019165c384f49d3.tar.gz
vyos-1x-50c506a9be56b548a8d461f3e019165c384f49d3.zip
ddclient: T5708: Migration to 3.11.1 and related improvements
- Migrate to ddclient 3.11.1 and enforce debian/control dependency - Add dual stack support for additional protocols - Restrict usage of `porkbun` protocol, VyOS configuration structure isn't compatible with porkbun yet - Improve and cleanup error messages
Diffstat (limited to 'src/migration-scripts/dns-dynamic/1-to-2')
-rw-r--r--src/migration-scripts/dns-dynamic/1-to-211
1 files changed, 11 insertions, 0 deletions
diff --git a/src/migration-scripts/dns-dynamic/1-to-2 b/src/migration-scripts/dns-dynamic/1-to-2
index 8aaedf210..8b599b57a 100644
--- a/src/migration-scripts/dns-dynamic/1-to-2
+++ b/src/migration-scripts/dns-dynamic/1-to-2
@@ -18,6 +18,8 @@
# - migrate "service dns dynamic timeout ..."
# to "service dns dynamic interval ..."
# - remove "service dns dynamic address <interface> web-options ..." when <interface> != "web"
+# - migrate "service dns dynamic address <interface> service <service> protocol dnsexit"
+# to "service dns dynamic address <interface> service <service> protocol dnsexit2"
import sys
from vyos.configtree import ConfigTree
@@ -51,6 +53,15 @@ for address in config.list_nodes(address_path):
if config.exists(address_path + [address, 'web-options']) and address != 'web':
config.delete(address_path + [address, 'web-options'])
+# Migrate "service dns dynamic address <interface> service <service> protocol dnsexit"
+# to "service dns dynamic address <interface> service <service> protocol dnsexit2"
+for address in config.list_nodes(address_path):
+ for svc_cfg in config.list_nodes(address_path + [address, 'service']):
+ if config.exists(address_path + [address, 'service', svc_cfg, 'protocol']):
+ protocol = config.return_value(address_path + [address, 'service', svc_cfg, 'protocol'])
+ if protocol == 'dnsexit':
+ config.set(address_path + [address, 'service', svc_cfg, 'protocol'], 'dnsexit2')
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())