From 8bec9c7ce19711c21207f9fea13127562dc10962 Mon Sep 17 00:00:00 2001 From: Benjamin Bohard Date: Thu, 12 Mar 2020 16:08:16 +0100 Subject: [PATCH] expose variables to environnement --- src/risotto/config.py | 8 +++++--- src/risotto/register.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/risotto/config.py b/src/risotto/config.py index 63b4950..2ae56d1 100644 --- a/src/risotto/config.py +++ b/src/risotto/config.py @@ -4,10 +4,12 @@ from os import environ CONFIGURATION_DIR = 'configurations' TMP_DIR = 'tmp' 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') MESSAGE_PATH = environ.get('MESSAGE_PATH', '/root/risotto-message/messages') 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(): @@ -22,8 +24,8 @@ def get_config(): 'check_role': True, 'admin_user': DEFAULT_USER, 'sql_dir': SQL_DIR}, - 'source': {'root_path': '/srv/seed'}, - 'cache': {'root_path': '/var/cache/risotto'}, + 'source': {'root_path': SRV_SEED_PATH}, + 'cache': {'root_path': CACHE_ROOT_PATH}, 'servermodel': {'internal_source': 'internal', 'internal_distribution': 'last', 'internal_release_name': 'none'}, diff --git a/src/risotto/register.py b/src/risotto/register.py index b3af396..80bf713 100644 --- a/src/risotto/register.py +++ b/src/risotto/register.py @@ -201,7 +201,7 @@ class RegisterDispatcher: else: missing_messages.append(message) 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): internal_user = get_config()['global']['internal_user']