do not ask release_id
This commit is contained in:
parent
251b521274
commit
7757912b55
65
README.md
65
README.md
|
@ -53,16 +53,58 @@ drop table value; drop table property; drop table permissive; drop table informa
|
||||||
./script/cucchiaiata applicationservice.dataset.updated -s eole -r last
|
./script/cucchiaiata applicationservice.dataset.updated -s eole -r last
|
||||||
./script/cucchiaiata servermodel.dataset.updated -s eole -r last
|
./script/cucchiaiata servermodel.dataset.updated -s eole -r last
|
||||||
|
|
||||||
# Create a server
|
# Create a new user and set role 'server_rw' for this server
|
||||||
./script/cucchiaiata server.create -s test -d description -m eolebase -n eole -r last
|
./script/cucchiaiata user.create -l gnunux -n gnunux -s gnunux
|
||||||
|
./script/cucchiaiata user.role.create -u gnunux -n 'server_rw' -a 'Server.ServerName' -v test
|
||||||
|
|
||||||
|
# Heritage
|
||||||
|
## ACA
|
||||||
|
./script/cucchiaiata servermodel.create -n aca -d Aca -p eolebase -s eole -r last
|
||||||
|
./script/cucchiaiata session.servermodel.start -s aca
|
||||||
|
S=xxxxxxxxxxxxxxxxxxxxxx
|
||||||
|
### verif
|
||||||
|
./script/cucchiaiata session.servermodel.get -s $S -n creole.reseau.unbound_route_address
|
||||||
|
./script/cucchiaiata session.servermodel.get -s $S -n creole.reseau.unbound_domain_name
|
||||||
|
./script/cucchiaiata session.servermodel.get -s $S -n creole.serveur_dns.unbound_local_zones
|
||||||
|
./script/cucchiaiata session.servermodel.get -s $S -n creole.reseau.unbound_ip_address_cidr
|
||||||
|
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --creole.reseau.unbound_route_address 192.168.1.2
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --creole.serveur_dns.unbound_allowed_client_cidr 192.168.1.0/24
|
||||||
|
./script/cucchiaiata session.servermodel.stop -s $S -a
|
||||||
|
|
||||||
|
## etab1
|
||||||
|
./script/cucchiaiata servermodel.create -n etab1 -d "Etab 1" -p aca -s internal -r last
|
||||||
|
./script/cucchiaiata session.servermodel.start -s etab1
|
||||||
|
S=xxxxxxxxxxxxxxxxxxxxxx
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --creole.reseau.unbound_domain_name test.cadoles.com
|
||||||
|
./script/cucchiaiata session.servermodel.stop -s $S -a
|
||||||
|
|
||||||
|
## unbound
|
||||||
|
./script/cucchiaiata servermodel.create -n unbound -d "generic unbound configuration" -p eolebase -s eole -r last
|
||||||
|
./script/cucchiaiata session.servermodel.start -s unbound
|
||||||
|
S=xxxxxxxxxxxxxxxxxxxxxx
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --creole.serveur_dns.unbound_local_zones cadoles.com
|
||||||
|
./script/cucchiaiata session.servermodel.filter -s $S -n unbound
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.hostname_cadoles_com toto titi
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.ip_cadoles_com 0 192.168.1.25
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.type_cadoles_com 1 CNAME
|
||||||
|
./script/cucchiaiata session.servermodel.configure -s $S --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.cname_cadoles_com 1 toto.cadoles.com
|
||||||
|
./script/cucchiaiata session.servermodel.stop -s $S -a
|
||||||
|
|
||||||
|
## unbound_etab1
|
||||||
|
./script/cucchiaiata servermodel.create -n unbound_etab1 -d "unbound configuration for etab1" -p etab1 unbound -s internal -r last
|
||||||
|
|
||||||
|
### verif
|
||||||
|
./script/cucchiaiata session.servermodel.start -s unbound_etab1
|
||||||
|
S=xxxxxxxxxxxxxxxxxxxxxx
|
||||||
|
XXXXX
|
||||||
|
|
||||||
|
# Create a server
|
||||||
|
./script/cucchiaiata server.create -s test -d description -m unbound_etab1 -n internal -r last
|
||||||
|
|
||||||
# Configure the server
|
|
||||||
./script/cucchiaiata session.server.start -s test
|
./script/cucchiaiata session.server.start -s test
|
||||||
S=xxxxxxxxxxxxxxxxxxxxxx
|
S=xxxxxxxxxxxxxxxxxxxxxx
|
||||||
./script/cucchiaiata session.server.configure -s $S --creole.reseau.unbound_ip_address_cidr 192.168.1.1/24 --creole.reseau.unbound_route_address 192.168.1.2 --creole.serveur_dns.unbound_allowed_client_cidr 192.168.1.0/24 --creole.serveur_dns.unbound_local_zones cadoles.com
|
./script/cucchiaiata session.server.configure -s $S --creole.reseau.unbound_ip_address_cidr 192.168.1.1/24
|
||||||
./script/cucchiaiata session.server.configure -s $S --creole.reseau.unbound_domain_name test.cadoles.com
|
|
||||||
./script/cucchiaiata session.server.filter -s $S -n unbound
|
|
||||||
./script/cucchiaiata session.server.configure -s $S --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.hostname_cadoles_com toto titi --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.ip_cadoles_com 0 192.168.1.25 --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.type_cadoles_com 1 CNAME --unbound.unbound_zone_cadoles_com.hostname_cadoles_com.cname_cadoles_com 1 toto.cadoles.com
|
|
||||||
./script/cucchiaiata session.server.validate -s $S
|
./script/cucchiaiata session.server.validate -s $S
|
||||||
./script/cucchiaiata session.server.stop -s $S -a
|
./script/cucchiaiata session.server.stop -s $S -a
|
||||||
|
|
||||||
|
@ -70,11 +112,6 @@ S=xxxxxxxxxxxxxxxxxxxxxx
|
||||||
./script/cucchiaiata config.configuration.server.deploy -s test
|
./script/cucchiaiata config.configuration.server.deploy -s test
|
||||||
./script/cucchiaiata template.generate -s test
|
./script/cucchiaiata template.generate -s test
|
||||||
|
|
||||||
# Create a new user and set role 'server_rw' for this server
|
|
||||||
./script/cucchiaiata user.create -l gnunux -n gnunux -s gnunux
|
|
||||||
./script/cucchiaiata user.role.create -u gnunux -n 'server_rw' -a 'Server.ServerName' -v test
|
|
||||||
|
|
||||||
# Heritage
|
# OpenSSH:
|
||||||
./script/cucchiaiata servermodel.create -n aca -d Aca -p eolebase -s eole -r last
|
./script/cucchiaiata server.create -s test -d description -m eolebase -n internal -r last
|
||||||
./script/cucchiaiata session.servermodel.start -s aca
|
|
||||||
./script/cucchiaiata session.servermodel.configure -s $S --creole.reseau.unbound_domain_name test.cadoles.com
|
|
||||||
|
|
|
@ -22,11 +22,6 @@ parameters:
|
||||||
shortarg: a
|
shortarg: a
|
||||||
description: ID des services applicatif donc dépendant le service applicatif.
|
description: ID des services applicatif donc dépendant le service applicatif.
|
||||||
default: []
|
default: []
|
||||||
release_id:
|
|
||||||
type: Number
|
|
||||||
shortarg: r
|
|
||||||
description: |
|
|
||||||
Identifiant de la version associée au service applicatif.
|
|
||||||
|
|
||||||
response:
|
response:
|
||||||
type: ApplicationService
|
type: ApplicationService
|
||||||
|
|
|
@ -12,11 +12,16 @@ parameters:
|
||||||
shortarg: n
|
shortarg: n
|
||||||
description: |
|
description: |
|
||||||
Nom du service applicatif à créer.
|
Nom du service applicatif à créer.
|
||||||
release_id:
|
source_name:
|
||||||
type: Number
|
type: String
|
||||||
|
shortarg: s
|
||||||
|
description: |
|
||||||
|
Nom de la source.
|
||||||
|
release_distribution:
|
||||||
|
type: String
|
||||||
shortarg: r
|
shortarg: r
|
||||||
description: |
|
description: |
|
||||||
Identifiant de la version associée au service applicatif.
|
Version associée au service applicatif.
|
||||||
|
|
||||||
response:
|
response:
|
||||||
type: ApplicationService
|
type: ApplicationService
|
||||||
|
|
|
@ -3,7 +3,6 @@ INTERNAL_USER = 'internal'
|
||||||
CONFIGURATION_DIR = 'configurations'
|
CONFIGURATION_DIR = 'configurations'
|
||||||
TEMPLATE_DIR = 'templates'
|
TEMPLATE_DIR = 'templates'
|
||||||
TMP_DIR = 'tmp'
|
TMP_DIR = 'tmp'
|
||||||
ROUGAIL_DTD_PATH = '../rougail/data/creole.dtd'
|
|
||||||
DEFAULT_USER = 'Anonymous'
|
DEFAULT_USER = 'Anonymous'
|
||||||
DEFAULT_DSN = 'postgres:///risotto?host=/var/run/postgresql/&user=risotto'
|
DEFAULT_DSN = 'postgres:///risotto?host=/var/run/postgresql/&user=risotto'
|
||||||
DEFAULT_TIRAMISU_DSN = 'postgres:///tiramisu?host=/var/run/postgresql/&user=tiramisu'
|
DEFAULT_TIRAMISU_DSN = 'postgres:///tiramisu?host=/var/run/postgresql/&user=tiramisu'
|
||||||
|
@ -23,7 +22,6 @@ def get_config():
|
||||||
'debug': True,
|
'debug': True,
|
||||||
'internal_user': 'internal',
|
'internal_user': 'internal',
|
||||||
'check_role': True,
|
'check_role': True,
|
||||||
'rougail_dtd_path': '../rougail/data/creole.dtd',
|
|
||||||
'admin_user': DEFAULT_USER},
|
'admin_user': DEFAULT_USER},
|
||||||
'source': {'root_path': '/srv/seed'},
|
'source': {'root_path': '/srv/seed'},
|
||||||
'cache': {'root_path': '/var/cache/risotto'},
|
'cache': {'root_path': '/var/cache/risotto'},
|
||||||
|
|
|
@ -15,6 +15,21 @@ class Risotto(Controller):
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
test: bool) -> None:
|
test: bool) -> None:
|
||||||
self.source_root_path = get_config().get('source').get('root_path')
|
self.source_root_path = get_config().get('source').get('root_path')
|
||||||
|
self.internal_source_name = get_config()['servermodel']['internal_source']
|
||||||
|
self.internal_distribution_name = get_config()['servermodel']['internal_distribution']
|
||||||
|
|
||||||
|
async def on_join(self,
|
||||||
|
risotto_context: Context) -> None:
|
||||||
|
internal_source = await self.call('v1.source.create',
|
||||||
|
risotto_context,
|
||||||
|
source_name=self.internal_source_name,
|
||||||
|
source_url='none')
|
||||||
|
internal_release = await self.call('v1.source.release.create',
|
||||||
|
risotto_context,
|
||||||
|
source_name=self.internal_source_name,
|
||||||
|
release_name='none',
|
||||||
|
release_distribution=self.internal_distribution_name)
|
||||||
|
self.internal_release_id = internal_release['release_id']
|
||||||
|
|
||||||
async def _applicationservice_create(self,
|
async def _applicationservice_create(self,
|
||||||
risotto_context: Context,
|
risotto_context: Context,
|
||||||
|
@ -35,30 +50,51 @@ class Risotto(Controller):
|
||||||
'applicationservice_release_id': release_id,
|
'applicationservice_release_id': release_id,
|
||||||
'applicationservice_id': applicationservice_id}
|
'applicationservice_id': applicationservice_id}
|
||||||
|
|
||||||
|
@register('v1.applicationservice.dependency.add')
|
||||||
|
async def applicationservice_dependency_add(self,
|
||||||
|
risotto_context: Context,
|
||||||
|
applicationservice_name: str,
|
||||||
|
applicationservice_dependency: str,
|
||||||
|
source_name: str,
|
||||||
|
release_distribution: str) -> Dict:
|
||||||
|
release = await self.call('v1.source.release.describe',
|
||||||
|
risotto_context,
|
||||||
|
source_name=source_name,
|
||||||
|
release_distribution=release_distribution)
|
||||||
|
as_descr = await self._applicationservice_describe(risotto_context,
|
||||||
|
applicationservice_name,
|
||||||
|
self.internal_release_id)
|
||||||
|
dependency_descr = await self._applicationservice_describe(risotto_context,
|
||||||
|
dependency,
|
||||||
|
release['release_id'])
|
||||||
|
as_descr['applicationservice_dependencies'].append(dependency_descr['applicationservice_id'])
|
||||||
|
sql = "UPDATE ApplicationService SET ApplicationServiceDependencies = $1 WHERE ApplicationServiceId = $2"
|
||||||
|
await risotto_context.connection.execute(sql,
|
||||||
|
as_descr['applicationservice_dependencies'],
|
||||||
|
as_descr['applicationserviceid'])
|
||||||
|
return as_descr
|
||||||
|
|
||||||
|
|
||||||
@register('v1.applicationservice.create')
|
@register('v1.applicationservice.create')
|
||||||
async def applicationservice_create(self,
|
async def applicationservice_create(self,
|
||||||
risotto_context: Context,
|
risotto_context: Context,
|
||||||
applicationservice_name: str,
|
applicationservice_name: str,
|
||||||
applicationservice_description: str,
|
applicationservice_description: str,
|
||||||
applicationservice_dependencies: List[int],
|
applicationservice_dependencies: List[int]) -> Dict:
|
||||||
release_id: int) -> Dict:
|
|
||||||
return await self._applicationservice_create(risotto_context,
|
return await self._applicationservice_create(risotto_context,
|
||||||
applicationservice_name,
|
applicationservice_name,
|
||||||
applicationservice_description,
|
applicationservice_description,
|
||||||
applicationservice_dependencies,
|
applicationservice_dependencies,
|
||||||
release_id)
|
self.internal_release_id)
|
||||||
|
|
||||||
@register('v1.applicationservice.dataset.updated')
|
@register('v1.applicationservice.dataset.updated')
|
||||||
async def applicationservice_update(self,
|
async def applicationservice_update(self,
|
||||||
risotto_context: Context,
|
risotto_context: Context,
|
||||||
source_name: str,
|
source_name: str,
|
||||||
release_distribution: str) -> Dict:
|
release_distribution: str) -> Dict:
|
||||||
source = await self.call('v1.source.describe',
|
release = await self.call('v1.source.release.describe',
|
||||||
risotto_context,
|
risotto_context,
|
||||||
source_name=source_name)
|
source_name=source_name,
|
||||||
release = await self.call('v1.source.release.get_by_distribution',
|
|
||||||
risotto_context,
|
|
||||||
source_id=source['source_id'],
|
|
||||||
release_distribution=release_distribution)
|
release_distribution=release_distribution)
|
||||||
applicationservice_path = join(self.source_root_path,
|
applicationservice_path = join(self.source_root_path,
|
||||||
source_name,
|
source_name,
|
||||||
|
@ -81,7 +117,7 @@ class Risotto(Controller):
|
||||||
await self._applicationservice_create(risotto_context,
|
await self._applicationservice_create(risotto_context,
|
||||||
applicationservice_description['name'],
|
applicationservice_description['name'],
|
||||||
applicationservice_description['description'],
|
applicationservice_description['description'],
|
||||||
[], # FIXME dependencies
|
[],
|
||||||
release_id)
|
release_id)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if get_config().get('global').get('debug'):
|
if get_config().get('global').get('debug'):
|
||||||
|
@ -104,8 +140,7 @@ class Risotto(Controller):
|
||||||
raise Exception(_(f'unknown service with ID {applicationservice_id}'))
|
raise Exception(_(f'unknown service with ID {applicationservice_id}'))
|
||||||
return dict(applicationservice)
|
return dict(applicationservice)
|
||||||
|
|
||||||
@register('v1.applicationservice.describe')
|
async def _applicationservice_describe(self,
|
||||||
async def applicationservice_describe(self,
|
|
||||||
risotto_context: Context,
|
risotto_context: Context,
|
||||||
applicationservice_name,
|
applicationservice_name,
|
||||||
release_id):
|
release_id):
|
||||||
|
@ -119,3 +154,18 @@ class Risotto(Controller):
|
||||||
if applicationservice is None:
|
if applicationservice is None:
|
||||||
raise Exception(_(f'unknown service {applicationservice_name} in release ID {release_id}'))
|
raise Exception(_(f'unknown service {applicationservice_name} in release ID {release_id}'))
|
||||||
return dict(applicationservice)
|
return dict(applicationservice)
|
||||||
|
|
||||||
|
|
||||||
|
@register('v1.applicationservice.describe')
|
||||||
|
async def applicationservice_describe(self,
|
||||||
|
risotto_context: Context,
|
||||||
|
applicationservice_name,
|
||||||
|
source_name,
|
||||||
|
release_distribution):
|
||||||
|
release = await self.call('v1.source.release.describe',
|
||||||
|
risotto_context,
|
||||||
|
source_name=source_name,
|
||||||
|
release_distribution=release_distribution)
|
||||||
|
return await self._applicationservice_describe(risotto_context,
|
||||||
|
applicationservice_name,
|
||||||
|
release['release_id'])
|
||||||
|
|
|
@ -7,10 +7,11 @@ from typing import Dict, List
|
||||||
|
|
||||||
from tiramisu import Storage, delete_session, MetaConfig, MixConfig
|
from tiramisu import Storage, delete_session, MetaConfig, MixConfig
|
||||||
from rougail import load as rougail_load
|
from rougail import load as rougail_load
|
||||||
|
from rougail.config import dtdfilename
|
||||||
|
|
||||||
from ...controller import Controller
|
from ...controller import Controller
|
||||||
from ...register import register
|
from ...register import register
|
||||||
from ...config import ROUGAIL_DTD_PATH, get_config
|
from ...config import get_config
|
||||||
from ...context import Context
|
from ...context import Context
|
||||||
from ...utils import _
|
from ...utils import _
|
||||||
from ...error import CallError, RegistrationError
|
from ...error import CallError, RegistrationError
|
||||||
|
@ -110,7 +111,7 @@ class Risotto(Controller):
|
||||||
# build tiramisu's session ID
|
# build tiramisu's session ID
|
||||||
session_id = f'v_{servermodel_id}'
|
session_id = f'v_{servermodel_id}'
|
||||||
optiondescription = rougail_load(xmlroot,
|
optiondescription = rougail_load(xmlroot,
|
||||||
ROUGAIL_DTD_PATH,
|
dtdfilename,
|
||||||
funcs_file)
|
funcs_file)
|
||||||
|
|
||||||
# build servermodel metaconfig (v_xxx.m_v_xxx)
|
# build servermodel metaconfig (v_xxx.m_v_xxx)
|
||||||
|
|
|
@ -5,6 +5,7 @@ from yaml import load, SafeLoader
|
||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List, Optional
|
||||||
from rougail import CreoleObjSpace
|
from rougail import CreoleObjSpace
|
||||||
|
from rougail.config import dtdfilename
|
||||||
from ...controller import Controller
|
from ...controller import Controller
|
||||||
from ...register import register
|
from ...register import register
|
||||||
from ...utils import _
|
from ...utils import _
|
||||||
|
@ -69,7 +70,6 @@ class Risotto(Controller):
|
||||||
as_names_str = '", "'.join(as_names)
|
as_names_str = '", "'.join(as_names)
|
||||||
await log.info(risotto_context,
|
await log.info(risotto_context,
|
||||||
_(f'gen funcs for "{servermodel_name}" with application services "{as_names_str}"'))
|
_(f'gen funcs for "{servermodel_name}" with application services "{as_names_str}"'))
|
||||||
#eolobj = CreoleObjSpace(get_config()['global']['rougail_dtd_path'])
|
|
||||||
|
|
||||||
async def servermodel_gen_schema(self,
|
async def servermodel_gen_schema(self,
|
||||||
servermodel_name: str,
|
servermodel_name: str,
|
||||||
|
@ -107,7 +107,7 @@ class Risotto(Controller):
|
||||||
continue
|
continue
|
||||||
as_names.add(applicationservice_name)
|
as_names.add(applicationservice_name)
|
||||||
extras.append((namespace, [extra_dir]))
|
extras.append((namespace, [extra_dir]))
|
||||||
eolobj = CreoleObjSpace(get_config()['global']['rougail_dtd_path'])
|
eolobj = CreoleObjSpace(dtdfilename)
|
||||||
as_names_str = '", "'.join(as_names)
|
as_names_str = '", "'.join(as_names)
|
||||||
await log.info(risotto_context,
|
await log.info(risotto_context,
|
||||||
_(f'gen schema for "{servermodel_name}" with application services "{as_names_str}"'))
|
_(f'gen schema for "{servermodel_name}" with application services "{as_names_str}"'))
|
||||||
|
@ -178,8 +178,7 @@ class Risotto(Controller):
|
||||||
risotto_context,
|
risotto_context,
|
||||||
applicationservice_name=as_name,
|
applicationservice_name=as_name,
|
||||||
applicationservice_description=as_description,
|
applicationservice_description=as_description,
|
||||||
applicationservice_dependencies=dependencies,
|
applicationservice_dependencies=dependencies)
|
||||||
release_id=self.internal_release_id)
|
|
||||||
applicationservice_id = applicationservice['applicationservice_id']
|
applicationservice_id = applicationservice['applicationservice_id']
|
||||||
servermodel_id = await risotto_context.connection.fetchval(servermodel_insert,
|
servermodel_id = await risotto_context.connection.fetchval(servermodel_insert,
|
||||||
servermodel_name,
|
servermodel_name,
|
||||||
|
@ -244,12 +243,9 @@ class Risotto(Controller):
|
||||||
risotto_context: Context,
|
risotto_context: Context,
|
||||||
source_name: str,
|
source_name: str,
|
||||||
release_distribution: int):
|
release_distribution: int):
|
||||||
source = await self.call('v1.source.describe',
|
release = await self.call('v1.source.release.describe',
|
||||||
risotto_context,
|
risotto_context,
|
||||||
source_name=source_name)
|
source_name=source_name,
|
||||||
release = await self.call('v1.source.release.get_by_distribution',
|
|
||||||
risotto_context,
|
|
||||||
source_id=source['source_id'],
|
|
||||||
release_distribution=release_distribution)
|
release_distribution=release_distribution)
|
||||||
release_id = release['release_id']
|
release_id = release['release_id']
|
||||||
servermodel_path = join(self.source_root_path,
|
servermodel_path = join(self.source_root_path,
|
||||||
|
@ -294,7 +290,8 @@ class Risotto(Controller):
|
||||||
applicationservice = await self.call('v1.applicationservice.describe',
|
applicationservice = await self.call('v1.applicationservice.describe',
|
||||||
risotto_context,
|
risotto_context,
|
||||||
applicationservice_name=depend,
|
applicationservice_name=depend,
|
||||||
release_id=release_id)
|
source_name=source_name,
|
||||||
|
release_distribution=release_distribution)
|
||||||
dependencies.append(applicationservice['applicationservice_id'])
|
dependencies.append(applicationservice['applicationservice_id'])
|
||||||
sm_name = servermodel_description['name']
|
sm_name = servermodel_description['name']
|
||||||
sm_description = servermodel_description['description']
|
sm_description = servermodel_description['description']
|
||||||
|
|
|
@ -122,7 +122,7 @@ class Risotto(Controller):
|
||||||
return [dict(r) for r in result]
|
return [dict(r) for r in result]
|
||||||
|
|
||||||
@register('v1.source.release.describe')
|
@register('v1.source.release.describe')
|
||||||
async def release_list(self,
|
async def release_describe(self,
|
||||||
risotto_context,
|
risotto_context,
|
||||||
source_name: str,
|
source_name: str,
|
||||||
release_distribution: str) -> Dict:
|
release_distribution: str) -> Dict:
|
||||||
|
@ -148,18 +148,3 @@ class Risotto(Controller):
|
||||||
if not result:
|
if not result:
|
||||||
raise Exception(_(f'unknown release id {release_id}'))
|
raise Exception(_(f'unknown release id {release_id}'))
|
||||||
return dict(result)
|
return dict(result)
|
||||||
|
|
||||||
@register('v1.source.release.get_by_distribution')
|
|
||||||
async def release_get_by_distribution(self,
|
|
||||||
risotto_context: Context,
|
|
||||||
source_id: int,
|
|
||||||
release_distribution: str) -> Dict:
|
|
||||||
release_query = """SELECT ReleaseId as release_id, SourceName as source_name, SourceURL as source_url, ReleaseName as release_name, ReleaseDistribution as release_distribution
|
|
||||||
FROM Release, Source
|
|
||||||
WHERE Release.ReleaseSourceId = $1 AND Release.ReleaseDistribution = $2 AND Source.SourceId = Release.ReleaseSourceId"""
|
|
||||||
result = await risotto_context.connection.fetchrow(release_query,
|
|
||||||
source_id,
|
|
||||||
release_distribution)
|
|
||||||
if not result:
|
|
||||||
raise Exception(_(f'unknown distribution {release_distribution} with source {source_id}'))
|
|
||||||
return dict(result)
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ class Risotto(Controller):
|
||||||
templates_dir,
|
templates_dir,
|
||||||
tmp_dir,
|
tmp_dir,
|
||||||
configurations_dir)
|
configurations_dir)
|
||||||
del meta
|
del meta, config
|
||||||
|
# FIXME del session !
|
||||||
return {'server_name': server_name,
|
return {'server_name': server_name,
|
||||||
'template_dir': configurations_dir}
|
'template_dir': configurations_dir}
|
||||||
|
|
|
@ -53,8 +53,6 @@ class Risotto(Controller):
|
||||||
'v1.session.server.validate',
|
'v1.session.server.validate',
|
||||||
'v1.source.describe',
|
'v1.source.describe',
|
||||||
'v1.source.list',
|
'v1.source.list',
|
||||||
'v1.source.release.get_by_distribution',
|
|
||||||
'v1.source.release.get_by_id',
|
|
||||||
'v1.source.release.list']:
|
'v1.source.release.list']:
|
||||||
try:
|
try:
|
||||||
await self._uri_role_join(risotto_context,
|
await self._uri_role_join(risotto_context,
|
||||||
|
|
Loading…
Reference in New Issue