datetime: Avoid error when systemctl is not available

This situation happens when building the package with cowbuilder.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2021-11-22 05:42:51 -08:00
1 parent 122bda7f7e
commit bec080ec90
1 file changed
+1 -1
+1 -1
View File
@@ -54,7 +54,7 @@ class DateTimeApp(app_module.App):
'--value', 'systemd-timesyncd'
])
self._time_managed = 'yes' in output.decode()
except subprocess.CalledProcessError:
except (FileNotFoundError, subprocess.CalledProcessError):
# When systemd is not running.
self._time_managed = False