add role server_rw + role example + deploy

This commit is contained in:
2020-01-15 09:15:15 +01:00
parent cb2dbe135e
commit 02c38589d4
16 changed files with 118 additions and 104 deletions

View File

@ -7,7 +7,6 @@ from json import dumps, loads
from .utils import _
from .error import CallError, NotAllowedError
from .logger import log
from .config import DEBUG
from .config import get_config
from .context import Context
from . import register
@ -193,7 +192,7 @@ class Dispatcher(register.RegisterDispatcher, CallDispatcher, PublishDispatcher)
try:
await subconfig.option(key).value.set(value)
except AttributeError:
if DEBUG:
if get_config()['global']['debug']:
print_exc()
raise ValueError(_(f'unknown parameter in "{uri}": "{key}"'))
# check mandatories options
@ -276,7 +275,7 @@ class Dispatcher(register.RegisterDispatcher, CallDispatcher, PublishDispatcher)
check_role)
except Exception as err:
# if there is a problem with arguments, just send an error and do nothing
if DEBUG:
if get_config()['global']['debug']:
print_exc()
await log.error_msg(risotto_context, kwargs, err)
if risotto_context.type == 'rpc':