2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Default to US if management node is n/a

localectl can be n/a for some scenarios,
default to US for such cases.
This commit is contained in:
Jarrod Johnson 2020-05-28 17:07:17 -04:00
parent 17b8000c0f
commit 335d06ea4c

View File

@ -93,6 +93,8 @@ def handle_request(env, start_response):
continue
if not isinstance(ccurrlocale, str):
ccurrlocale = ccurrlocale.decode('utf8')
if ccurrlocale == 'n/a':
continue
currlocale = ccurrlocale
elif line.startswith(b'VC Keymap:'):
ckeymap = line.split(b':')[-1]
@ -101,6 +103,8 @@ def handle_request(env, start_response):
continue
if not isinstance(ckeymap, str):
ckeymap = ckeymap.decode('utf8')
if ckeymap == 'n/a':
continue
keymap = ckeymap
tdc = subprocess.check_output(['timedatectl']).split(b'\n')
for ent in tdc: