Compare commits
No commits in common. "9423cdef8d2b1983c85d6b010bd3d3c2d0f4becc" and "fc5a13152bc195d2d50f54965acfa9a60b09ddfa" have entirely different histories.
9423cdef8d
...
fc5a13152b
|
@ -65,18 +65,6 @@ if 'CELERYRISOTTO_DB_USER' in environ:
|
||||||
CELERYRISOTTO_DB_USER = environ['CELERYRISOTTO_DB_USER']
|
CELERYRISOTTO_DB_USER = environ['CELERYRISOTTO_DB_USER']
|
||||||
else:
|
else:
|
||||||
CELERYRISOTTO_DB_USER = config.get('CELERYRISOTTO_DB_USER', None)
|
CELERYRISOTTO_DB_USER = config.get('CELERYRISOTTO_DB_USER', None)
|
||||||
if 'LEMUR_DB_NAME' in environ:
|
|
||||||
LEMUR_DB_NAME = environ['LEMUR_DB_NAME']
|
|
||||||
else:
|
|
||||||
LEMUR_DB_NAME = config.get('LEMUR_DB_NAME', None)
|
|
||||||
if 'LEMUR_DB_PASSWORD' in environ:
|
|
||||||
LEMUR_DB_PASSWORD = environ['LEMUR_DB_PASSWORD']
|
|
||||||
else:
|
|
||||||
LEMUR_DB_PASSWORD = config.get('LEMUR_DB_PASSWORD', None)
|
|
||||||
if 'LEMUR_DB_USER' in environ:
|
|
||||||
LEMUR_DB_USER = environ['LEMUR_DB_USER']
|
|
||||||
else:
|
|
||||||
LEMUR_DB_USER = config.get('LEMUR_DB_USER', None)
|
|
||||||
if 'DB_ADDRESS' in environ:
|
if 'DB_ADDRESS' in environ:
|
||||||
DB_ADDRESS = environ['DB_ADDRESS']
|
DB_ADDRESS = environ['DB_ADDRESS']
|
||||||
else:
|
else:
|
||||||
|
@ -153,8 +141,7 @@ def dsn_factory(database, user, password, address=DB_ADDRESS):
|
||||||
|
|
||||||
_config = {'database': {'dsn': dsn_factory(RISOTTO_DB_NAME, RISOTTO_DB_USER, RISOTTO_DB_PASSWORD),
|
_config = {'database': {'dsn': dsn_factory(RISOTTO_DB_NAME, RISOTTO_DB_USER, RISOTTO_DB_PASSWORD),
|
||||||
'tiramisu_dsn': dsn_factory(TIRAMISU_DB_NAME, TIRAMISU_DB_USER, TIRAMISU_DB_PASSWORD),
|
'tiramisu_dsn': dsn_factory(TIRAMISU_DB_NAME, TIRAMISU_DB_USER, TIRAMISU_DB_PASSWORD),
|
||||||
'celery_dsn': dsn_factory(CELERYRISOTTO_DB_NAME, CELERYRISOTTO_DB_USER, CELERYRISOTTO_DB_PASSWORD),
|
'celery_dsn': dsn_factory(CELERYRISOTTO_DB_NAME, CELERYRISOTTO_DB_USER, CELERYRISOTTO_DB_PASSWORD)
|
||||||
'lemur_dns': dsn_factory(LEMUR_DB_NAME, LEMUR_DB_USER, LEMUR_DB_PASSWORD),
|
|
||||||
},
|
},
|
||||||
'http_server': {'port': RISOTTO_PORT,
|
'http_server': {'port': RISOTTO_PORT,
|
||||||
'default_user': DEFAULT_USER,
|
'default_user': DEFAULT_USER,
|
||||||
|
|
|
@ -475,8 +475,6 @@ class Dispatcher(register.RegisterDispatcher,
|
||||||
)
|
)
|
||||||
# notification
|
# notification
|
||||||
if function_obj.get('notification'):
|
if function_obj.get('notification'):
|
||||||
if returns is None:
|
|
||||||
raise Exception(_(f'function "{function_obj["full_module_name"]}.{function_obj["function"].__name__}" must returns something for {function_obj["notification"]}!'))
|
|
||||||
notif_version, notif_message = function_obj['notification'].split('.', 1)
|
notif_version, notif_message = function_obj['notification'].split('.', 1)
|
||||||
if not isinstance(returns, list):
|
if not isinstance(returns, list):
|
||||||
send_returns = [returns]
|
send_returns = [returns]
|
||||||
|
|
|
@ -23,13 +23,9 @@ extra_statics = {}
|
||||||
|
|
||||||
def create_context(request):
|
def create_context(request):
|
||||||
risotto_context = Context()
|
risotto_context = Context()
|
||||||
if 'username' in dict(request.match_info):
|
risotto_context.username = request.match_info.get('username',
|
||||||
username = request.match_info['username']
|
get_config()['http_server']['default_user'],
|
||||||
elif 'username' in request.headers:
|
)
|
||||||
username = request.headers['username']
|
|
||||||
else:
|
|
||||||
username = get_config()['http_server']['default_user']
|
|
||||||
risotto_context.username = username
|
|
||||||
return risotto_context
|
return risotto_context
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ class Logger:
|
||||||
await connection.execute(sql,
|
await connection.execute(sql,
|
||||||
risotto_context.start_id,
|
risotto_context.start_id,
|
||||||
datetime.now(),
|
datetime.now(),
|
||||||
err[:254],
|
err,
|
||||||
LEVELS.index('Failure'),
|
LEVELS.index('Failure'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,6 @@ class RegisterDispatcher:
|
||||||
version = obj['version']
|
version = obj['version']
|
||||||
if version not in self.messages:
|
if version not in self.messages:
|
||||||
self.messages[version] = {}
|
self.messages[version] = {}
|
||||||
obj['message'] = tiramisu_message
|
|
||||||
self.messages[version][tiramisu_message] = obj
|
self.messages[version][tiramisu_message] = obj
|
||||||
|
|
||||||
def get_function_args(self,
|
def get_function_args(self,
|
||||||
|
|
Loading…
Reference in New Issue