mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
Fix lang in EL8 install
While text mode does not care, if user goes down graphical path, it pauses installer.
This commit is contained in:
parent
c459990457
commit
5dee338d50
@ -1,6 +1,7 @@
|
||||
%include /tmp/rootpw
|
||||
%include /tmp/timezone
|
||||
%include /tmp/partitioning
|
||||
%include /tmp/langinfo
|
||||
reboot
|
||||
|
||||
%packages
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/sh
|
||||
nodename=$(grep ^NODENAME /etc/confluent.info|awk '{print $2}')
|
||||
locale=$(grep ^locale: /etc/confluent.deploycfg)
|
||||
locale=${locale#locale: }
|
||||
echo lang $locale > /tmp/langinfo
|
||||
tz=$(grep ^timezone: /etc/confluent.deploycfg)
|
||||
tz=${tz#*: }
|
||||
tz=${tz#timezone: }
|
||||
echo timezone $tz --utc > /tmp/timezone
|
||||
rootpw=$(grep ^rootpassword /etc/confluent.deploycfg | awk '{print $2}')
|
||||
if [ "$rootpw" = null ]; then
|
||||
|
@ -10,6 +10,7 @@ import time
|
||||
import yaml
|
||||
|
||||
currtz = None
|
||||
currlocale = en_US.UTF-8
|
||||
currtzvintage = None
|
||||
|
||||
|
||||
@ -19,6 +20,7 @@ def yamldump(input):
|
||||
|
||||
def handle_request(env, start_response):
|
||||
global currtz
|
||||
global currlocale
|
||||
global currtzvintage
|
||||
nodename = env.get('HTTP_CONFLUENT_NODENAME', None)
|
||||
apikey = env.get('HTTP_CONFLUENT_APIKEY', None)
|
||||
@ -79,6 +81,17 @@ def handle_request(env, start_response):
|
||||
if currtzvintage and currtzvintage > (time.time() - 30.0):
|
||||
ncfg['timezone'] = currtz
|
||||
else:
|
||||
langinfo = subprocess.check_output(
|
||||
['localectl', 'status']).split(b'\n')
|
||||
for line in langinfo:
|
||||
line = line.strip()
|
||||
if line.startswith('System Locale:'):
|
||||
currlocale = line.split('=')[-1]
|
||||
if not currlocale:
|
||||
continue
|
||||
if not isinstance(currlocale, str):
|
||||
currlocale = currlocale.decode('utf8')
|
||||
break
|
||||
tdc = subprocess.check_output(['timedatectl']).split(b'\n')
|
||||
for ent in tdc:
|
||||
ent = ent.strip()
|
||||
@ -89,6 +102,7 @@ def handle_request(env, start_response):
|
||||
currtzvintage = time.time()
|
||||
ncfg['timezone'] = currtz
|
||||
break
|
||||
ncfg['locale'] = currlocale
|
||||
ncfg['nameservers'] = []
|
||||
for dns in deployinfo.get(
|
||||
'services.dns', {}).get('value', '').split(','):
|
||||
|
Loading…
Reference in New Issue
Block a user