Skip to content

Commit

Permalink
[generic-config-updater] Add NTP validator (#2212)
Browse files Browse the repository at this point in the history
What I did
When GCU config NTP_SERVER table, its change is not actually taken info effect. Because NTP service is not restarted. So I add NTP service validator and restart service when NTP_SERVER is changed.

How I did it
When NTP_SERVER table being configured through GCU, the ntp service will restart.

How to verify it
Run GCU E2E test for NTP_SERVER table.
  • Loading branch information
wen587 authored and yxieca committed Jun 17, 2022
1 parent 6f4991e commit 13ec600
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generic_config_updater/generic_config_updater.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
},
"ACL_RULE": {
"services_to_validate": [ "caclmgrd-service" ]
},
"NTP_SERVER": {
"services_to_validate": [ "ntp-service" ]
}
},
"services": {
Expand All @@ -65,6 +68,9 @@
},
"caclmgrd-service": {
"validate_commands": [ "generic_config_updater.services_validator.caclmgrd_validator" ]
},
"ntp-service": {
"validate_commands": [ "generic_config_updater.services_validator.ntp_validator" ]
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions generic_config_updater/services_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,6 @@ def caclmgrd_validator(old_config, upd_config, keys):
# No update to ACL_RULE.
return True


def ntp_validator(old_config, upd_config, keys):
return _service_restart("ntp-config")

0 comments on commit 13ec600

Please sign in to comment.