mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 04:53:01 +02:00
cli: fix "show ntp" command when ntp is not enabled
Instead of 'show ntp' =>
Error, top level "ietf-system:system-state" missing
Try something nicer:
NTP client not enabled.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -1020,8 +1020,8 @@ def show_hardware(json):
|
||||
|
||||
def show_ntp(json):
|
||||
if not json.get("ietf-system:system-state"):
|
||||
print(f"Error, top level \"ietf-system:system-state\" missing")
|
||||
sys.exit(1)
|
||||
print("NTP client not enabled.")
|
||||
return
|
||||
hdr = (f"{'ADDRESS':<{PadNtpSource.address}}"
|
||||
f"{'MODE':<{PadNtpSource.mode}}"
|
||||
f"{'STATE':<{PadNtpSource.state}}"
|
||||
|
||||
Reference in New Issue
Block a user