summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-01-26 13:07:59 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-01-26 13:07:59 -0600
commit571b0db7cf7878e353857f51da7f1e41fdcca354 (patch)
tree7fb24735b8be207f45e7d68c5e27b0e4b1526ee3
parent1ff1fa8592f2cfd241368dd716180b23a2e9bb1b (diff)
downloadvyos-1x-571b0db7cf7878e353857f51da7f1e41fdcca354.tar.gz
vyos-1x-571b0db7cf7878e353857f51da7f1e41fdcca354.zip
ntp: T4961: create path ['service'] if it doesn't exist
config.copy does not recursively create nodes of the path. On install image, the path ['service'] is not present in config.boot.default, so must be created before config.copy['service', 'ntp'].
-rwxr-xr-xsrc/migration-scripts/ntp/1-to-25
1 files changed, 5 insertions, 0 deletions
diff --git a/src/migration-scripts/ntp/1-to-2 b/src/migration-scripts/ntp/1-to-2
index 4a701e7e5..d1e510e4c 100755
--- a/src/migration-scripts/ntp/1-to-2
+++ b/src/migration-scripts/ntp/1-to-2
@@ -37,6 +37,11 @@ if not config.exists(base_path):
# Nothing to do
sys.exit(0)
+# config.copy does not recursively create a path, so create ['service'] if
+# it doesn't yet exist, such as for config.boot.default
+if not config.exists(['service']):
+ config.set(['service'])
+
# copy "system ntp" to "service ntp"
config.copy(base_path, new_base_path)
config.delete(base_path)