expose variables to environnement
This commit is contained in:
parent
cc6dd3efe3
commit
8bec9c7ce1
|
@ -4,10 +4,12 @@ from os import environ
|
||||||
CONFIGURATION_DIR = 'configurations'
|
CONFIGURATION_DIR = 'configurations'
|
||||||
TMP_DIR = 'tmp'
|
TMP_DIR = 'tmp'
|
||||||
DEFAULT_USER = environ.get('DEFAULT_USER', 'Anonymous')
|
DEFAULT_USER = environ.get('DEFAULT_USER', 'Anonymous')
|
||||||
DEFAULT_DSN = environ.get('RISOTTO_DSN', 'postgres:///risotto?host=/var/run/postgresql/&user=risotto')
|
DEFAULT_DSN = environ.get('DEFAULT_DSN', 'postgres:///risotto?host=/var/run/postgresql/&user=risotto')
|
||||||
DEFAULT_TIRAMISU_DSN = environ.get('DEFAULT_TIRAMISU_DSN', 'postgres:///tiramisu?host=/var/run/postgresql/&user=tiramisu')
|
DEFAULT_TIRAMISU_DSN = environ.get('DEFAULT_TIRAMISU_DSN', 'postgres:///tiramisu?host=/var/run/postgresql/&user=tiramisu')
|
||||||
MESSAGE_PATH = environ.get('MESSAGE_PATH', '/root/risotto-message/messages')
|
MESSAGE_PATH = environ.get('MESSAGE_PATH', '/root/risotto-message/messages')
|
||||||
SQL_DIR = environ.get('SQL_DIR', './sql')
|
SQL_DIR = environ.get('SQL_DIR', './sql')
|
||||||
|
CACHE_ROOT_PATH = environ.get('CACHE_ROOT_PATH', '/var/cache/risotto')
|
||||||
|
SRV_SEED_PATH = environ.get('SRV_SEED_PATH', '/srv/seed')
|
||||||
|
|
||||||
|
|
||||||
def get_config():
|
def get_config():
|
||||||
|
@ -22,8 +24,8 @@ def get_config():
|
||||||
'check_role': True,
|
'check_role': True,
|
||||||
'admin_user': DEFAULT_USER,
|
'admin_user': DEFAULT_USER,
|
||||||
'sql_dir': SQL_DIR},
|
'sql_dir': SQL_DIR},
|
||||||
'source': {'root_path': '/srv/seed'},
|
'source': {'root_path': SRV_SEED_PATH},
|
||||||
'cache': {'root_path': '/var/cache/risotto'},
|
'cache': {'root_path': CACHE_ROOT_PATH},
|
||||||
'servermodel': {'internal_source': 'internal',
|
'servermodel': {'internal_source': 'internal',
|
||||||
'internal_distribution': 'last',
|
'internal_distribution': 'last',
|
||||||
'internal_release_name': 'none'},
|
'internal_release_name': 'none'},
|
||||||
|
|
|
@ -201,7 +201,7 @@ class RegisterDispatcher:
|
||||||
else:
|
else:
|
||||||
missing_messages.append(message)
|
missing_messages.append(message)
|
||||||
if missing_messages:
|
if missing_messages:
|
||||||
raise RegistrationError(_(f'missing uri {missing_messages}'))
|
raise RegistrationError(_(f'no matching function for uri {missing_messages}'))
|
||||||
|
|
||||||
async def on_join(self):
|
async def on_join(self):
|
||||||
internal_user = get_config()['global']['internal_user']
|
internal_user = get_config()['global']['internal_user']
|
||||||
|
|
Loading…
Reference in New Issue