diff --git a/src/risotto/dispatcher.py b/src/risotto/dispatcher.py index 7bc464d..08b2343 100644 --- a/src/risotto/dispatcher.py +++ b/src/risotto/dispatcher.py @@ -49,22 +49,22 @@ class CallDispatcher: for key, value in ret.items(): await config.option(key).value.set(value) except AttributeError: - err = _(f'function {module_name}.{function_name} return the unknown parameter "{key}"') + err = _(f'function {module_name}.{function_name} return the unknown parameter "{key}" for the uri "{risotto_context.version}.{risotto_context.message}"') await log.error_msg(risotto_context, kwargs, err) raise CallError(str(err)) except ValueError: - err = _(f'function {module_name}.{function_name} return the parameter "{key}" with an unvalid value "{value}"') + err = _(f'function {module_name}.{function_name} return the parameter "{key}" with an unvalid value "{value}" for the uri "{risotto_context.version}.{risotto_context.message}"') await log.error_msg(risotto_context, kwargs, err) raise CallError(str(err)) await config.property.read_only() mandatories = await config.value.mandatory() if mandatories: mand = [mand.split('.')[-1] for mand in mandatories] - raise ValueError(_(f'missing parameters in response of the message "{risotto_context.version}.{risotto_context.message}": {mand} in message')) + raise ValueError(_(f'missing parameters in response of the uri "{risotto_context.version}.{risotto_context.message}": {mand} in message')) try: await config.value.dict() except Exception as err: - err = _(f'function {module_name}.{function_name} return an invalid response {err}') + err = _(f'function {module_name}.{function_name} return an invalid response {err} for the uri "{risotto_context.version}.{risotto_context.message}"') await log.error_msg(risotto_context, kwargs, err) raise CallError(str(err)) @@ -163,6 +163,8 @@ class PublishDispatcher: 'context': risotto_context.__dict__, }) risotto_context.connection = old_risotto_context.connection + # FIXME should be better :/ + remote_kw = remote_kw.replace("'", "''") await risotto_context.connection.execute(f'NOTIFY "{version}.{message}", \'{remote_kw}\'') return await self.launch(version, message, diff --git a/src/risotto/register.py b/src/risotto/register.py index 20ed685..c2db5cb 100644 --- a/src/risotto/register.py +++ b/src/risotto/register.py @@ -300,7 +300,7 @@ class RegisterDispatcher: ) if truncate: async with connection.transaction(): - await connection.execute('TRUNCATE InfraServer, InfraSite, InfraZone, Log, ProviderDeployment, ProviderFactoryCluster, ProviderFactoryClusterNode, SettingApplicationservice, SettingApplicationServiceDependency, SettingRelease, SettingServer, SettingServermodel, SettingSource, UserRole, UserRoleURI, UserURI, UserUser, InfraServermodel, ProviderZone, ProviderServer, ProviderServermodel') + await connection.execute('TRUNCATE InfraServer, InfraSite, InfraZone, Log, ProviderDeployment, ProviderFactoryCluster, ProviderFactoryClusterNode, SettingApplicationservice, SettingApplicationServiceDependency, SettingRelease, SettingServer, SettingServermodel, SettingSource, UserRole, UserRoleURI, UserURI, UserUser, InfraServermodel, ProviderZone, ProviderServer, ProviderSource, ProviderApplicationservice ProviderServermodel') async with connection.transaction(): for submodule_name, module in self.injected_self.items(): risotto_context = Context()