diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-01-24 00:59:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-24 00:59:47 +0000 |
commit | a2487366e11a501d26b78e868dc313ef34f7fb96 (patch) | |
tree | faa0726f1994236c067531ad433ea4bbd230eb8f /src | |
parent | 62680c883d440285fe399bcc9fa7591648542dae (diff) | |
parent | 12616b3da02600a27922dc1e275886c3b80ca1f8 (diff) | |
download | vyos-1x-a2487366e11a501d26b78e868dc313ef34f7fb96.tar.gz vyos-1x-a2487366e11a501d26b78e868dc313ef34f7fb96.zip |
Merge pull request #4315 from c-po/ntp-fix-T6911
ntp: T6911: fix migration script to not allow empty "service ntp" CLI node
Diffstat (limited to 'src')
-rw-r--r-- | src/migration-scripts/ntp/1-to-2 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/migration-scripts/ntp/1-to-2 b/src/migration-scripts/ntp/1-to-2 index fd7b08221..d5f800922 100644 --- a/src/migration-scripts/ntp/1-to-2 +++ b/src/migration-scripts/ntp/1-to-2 @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors <maintainers@vyos.io> +# Copyright 2023-2025 VyOS maintainers and contributors <maintainers@vyos.io> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,11 @@ def migrate(config: ConfigTree) -> None: # Nothing to do return + # T6911: do not migrate NTP configuration if mandatory server is missing + if not config.exists(base_path + ['server']): + config.delete(base_path) + return + # 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']): |