2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-28 20:39:40 +00:00

Fall back if timedatectl doesn't work

This commit is contained in:
Jarrod Johnson 2021-12-15 12:34:28 -05:00
parent 48ea6225aa
commit 016ee3ecb0

View File

@ -235,7 +235,10 @@ def handle_request(env, start_response):
if ckeymap == 'n/a':
continue
keymap = ckeymap
tdc = util.run(['timedatectl'])[0].split(b'\n')
try:
tdc = util.run(['timedatectl'])[0].split(b'\n')
except subprocess.CalledProcessError:
tdc = []
for ent in tdc:
ent = ent.strip()
if ent.startswith(b'Time zone:'):