From 8621c726bb7ac14c2302fa4bf0dc0884334be7bd Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 18 Dec 2022 11:34:21 +0100 Subject: [PATCH] bundles/systemd: fix edgecase in check_timesyncd_sync --- bundles/systemd/files/check_timesyncd_sync | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bundles/systemd/files/check_timesyncd_sync b/bundles/systemd/files/check_timesyncd_sync index 1e2e511..877eac8 100644 --- a/bundles/systemd/files/check_timesyncd_sync +++ b/bundles/systemd/files/check_timesyncd_sync @@ -29,6 +29,11 @@ try: print('NTP service is active, but could not get offset. Something is wrong.') exit(1) + if out in ('+0', '-0', '0'): + # if the offset is exactly zero, timedatectl only shows '0', thus + # breaking the logic below. + out = '0ms' + if out.startswith('+'): out = out[1:]