Compare commits

..

No commits in common. "5708cb1ea929b2bf736eeffd5f67fb0ca93fb209" and "9741669487aaf7e16140932120ca46370c4ccb5d" have entirely different histories.

3 changed files with 41 additions and 45 deletions

View File

@ -36,19 +36,12 @@ Chacun de ces services documente la structure de la table mais ne se charge pas
La création de la table, selon le schéma fournit dans la documentation, est à la charge de ladministrateur du système. La création de la table, selon le schéma fournit dans la documentation, est à la charge de ladministrateur du système.
# Empty database: # Empty database:
su - postgres
psql -U postgres risotto
drop table log; drop table userrole; drop table release; drop table source; drop table server; drop table servermodel; drop table applicationservice; drop table roleuri; drop table risottouser; drop table uri;
````
psql -U postgres
drop database risotto;
drop user risotto;
\q
reconfigure
```
```
psql -U postgres tiramisu psql -U postgres tiramisu
drop table value; drop table property; drop table permissive; drop table information; drop table session; drop table value; drop table property; drop table permissive; drop table information; drop table session;
```
# Import EOLE # Import EOLE
./script/cucchiaiata source.create -n eole -u http://localhost ./script/cucchiaiata source.create -n eole -u http://localhost

View File

@ -3,7 +3,7 @@ from os import environ
CONFIGURATION_DIR = environ.get('CONFIGURATION_DIR', '/srv/risotto/configurations') CONFIGURATION_DIR = environ.get('CONFIGURATION_DIR', '/srv/risotto/configurations')
PROVIDER_FACTORY_CONFIG_DIR = environ.get('PROVIDER_FACTORY_CONFIG_DIR', '/srv/factory') PROVIDER_FACTORY_CONFIG_DIR = environ.get('PROVIDER_FACTORY_CONFIG_DIR', '/srv/factory')
TMP_DIR = '/tmp' TMP_DIR = 'tmp'
DEFAULT_USER = environ.get('DEFAULT_USER', 'Anonymous') DEFAULT_USER = environ.get('DEFAULT_USER', 'Anonymous')
RISOTTO_DB_NAME = environ.get('RISOTTO_DB_NAME', 'risotto') RISOTTO_DB_NAME = environ.get('RISOTTO_DB_NAME', 'risotto')
RISOTTO_DB_PASSWORD = environ.get('RISOTTO_DB_PASSWORD', 'risotto') RISOTTO_DB_PASSWORD = environ.get('RISOTTO_DB_PASSWORD', 'risotto')

View File

@ -147,39 +147,40 @@ class PublishDispatcher:
check_role, check_role,
kwargs, kwargs,
function_objs) function_objs)
try: else:
async with self.pool.acquire() as connection: try:
await connection.set_type_codec( async with self.pool.acquire() as connection:
'json', await connection.set_type_codec(
encoder=dumps, 'json',
decoder=loads, encoder=dumps,
schema='pg_catalog' decoder=loads,
) schema='pg_catalog'
risotto_context.connection = connection )
async with connection.transaction(): risotto_context.connection = connection
return await self.launch(version, async with connection.transaction():
message, return await self.launch(version,
risotto_context, message,
check_role, risotto_context,
kwargs, check_role,
function_objs) kwargs,
except CallError as err: function_objs)
raise err except CallError as err:
except Exception as err: raise err
# if there is a problem with arguments, just send an error and do nothing except Exception as err:
if get_config()['global']['debug']: # if there is a problem with arguments, just send an error and do nothing
print_exc() if get_config()['global']['debug']:
async with self.pool.acquire() as connection: print_exc()
await connection.set_type_codec( async with self.pool.acquire() as connection:
'json', await connection.set_type_codec(
encoder=dumps, 'json',
decoder=loads, encoder=dumps,
schema='pg_catalog' decoder=loads,
) schema='pg_catalog'
risotto_context.connection = connection )
async with connection.transaction(): risotto_context.connection = connection
await log.error_msg(risotto_context, kwargs, err) async with connection.transaction():
raise err await log.error_msg(risotto_context, kwargs, err)
raise err
class Dispatcher(register.RegisterDispatcher, class Dispatcher(register.RegisterDispatcher,
@ -328,6 +329,8 @@ class Dispatcher(register.RegisterDispatcher,
if key in function_obj['arguments']: if key in function_obj['arguments']:
kw[key] = value kw[key] = value
kw['risotto_context'] = risotto_context kw['risotto_context'] = risotto_context
returns = await function(self.injected_self[function_obj['module']], **kw) returns = await function(self.injected_self[function_obj['module']], **kw)
if risotto_context.type == 'rpc': if risotto_context.type == 'rpc':