2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-11 12:06:26 +00:00

Keep the defaults when localectl reports nothing set

Newer systemd prints '(unset)' where it used to print 'n/a', so an
unset console keymap was handed to the installer verbatim. An unset
System Locale has no '=' either, and the whole line was being taken
as the locale.
This commit is contained in:
Markus Hilger
2026-09-07 05:18:43 +02:00
parent 42ca73eb21
commit 46920e8436
+4 -2
View File
@@ -367,12 +367,14 @@ async def handle_request(req, make_response, mimetype):
for line in langinfo:
line = line.strip()
if line.startswith(b'System Locale:'):
if b'=' not in line:
continue
ccurrlocale = line.split(b'=')[-1]
if not ccurrlocale:
continue
if not isinstance(ccurrlocale, str):
ccurrlocale = ccurrlocale.decode('utf8')
if ccurrlocale == 'n/a':
if ccurrlocale in ('n/a', '(unset)'):
continue
currlocale = ccurrlocale
elif line.startswith(b'VC Keymap:'):
@@ -382,7 +384,7 @@ async def handle_request(req, make_response, mimetype):
continue
if not isinstance(ckeymap, str):
ckeymap = ckeymap.decode('utf8')
if ckeymap == 'n/a':
if ckeymap in ('n/a', '(unset)'):
continue
keymap = ckeymap
try: