Changed __init__-py

This commit is contained in:
sebastiankloth
2022-04-20 14:09:50 +02:00
parent f643edd405
commit 9d39fae0dd

View File

@ -9,13 +9,13 @@ config.read([
os.environ.get('STORE_CONFIG', '') os.environ.get('STORE_CONFIG', '')
]) ])
PGPASS = '/nfsopt/mdevaluate/pgpass' #PGPASS = '/nfsopt/mdevaluate/pgpass'
if os.path.exists(PGPASS): #if os.path.exists(PGPASS):
with open(PGPASS) as f: # with open(PGPASS) as f:
for pgpass in f: # for pgpass in f:
hostname, *_, username, password = pgpass.split(':') # hostname, *_, username, password = pgpass.split(':')
if hostname == 'db.cluster' and username == 'store': # if hostname == 'db.cluster' and username == 'store':
config['store']['pg_password'] = password.strip() # config['store']['pg_password'] = password.strip()
# we sometimes have problems with the internal DNS, therefore try to resolve # we sometimes have problems with the internal DNS, therefore try to resolve
# the database host in advance and use IP directly # the database host in advance and use IP directly