diff options
author | John Estabrook <jestabro@vyos.io> | 2023-01-26 13:07:59 -0600 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-01-26 13:07:59 -0600 |
commit | 571b0db7cf7878e353857f51da7f1e41fdcca354 (patch) | |
tree | 7fb24735b8be207f45e7d68c5e27b0e4b1526ee3 | |
parent | 1ff1fa8592f2cfd241368dd716180b23a2e9bb1b (diff) | |
download | vyos-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-x | src/migration-scripts/ntp/1-to-2 | 5 |
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) |