Skip to content
Snippets Groups Projects
Commit c4eca8da authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Context component:

- Updated link_set to add the link to admin/admin context/topology by default
parent 24a4f276
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!110Partial fix OECC/PSC'22 test, InterDomain component, and other side improvements
......@@ -18,9 +18,10 @@ from sqlalchemy.engine import Engine
from sqlalchemy.orm import Session, selectinload, sessionmaker
from sqlalchemy_cockroachdb import run_transaction
from typing import Dict, List, Optional, Set, Tuple
from common.proto.context_pb2 import Link, LinkId
from common.proto.context_pb2 import Link, LinkId, TopologyId
from common.method_wrappers.ServiceExceptions import NotFoundException
from common.tools.object_factory.Link import json_link_id
from context.service.database.uuids.Topology import topology_get_uuid
from .models.LinkModel import LinkModel, LinkEndPointModel
from .models.TopologyModel import TopologyLinkModel
from .uuids.EndPoint import endpoint_get_uuid
......@@ -67,6 +68,15 @@ def link_set(db_engine : Engine, request : Link) -> Tuple[Dict, bool]:
topology_uuids : Set[str] = set()
related_topologies : List[Dict] = list()
# By default, always add link to default Context/Topology
_,topology_uuid = topology_get_uuid(TopologyId(), allow_random=False, allow_default=True)
related_topologies.append({
'topology_uuid': topology_uuid,
'link_uuid' : link_uuid,
})
topology_uuids.add(topology_uuid)
link_endpoints_data : List[Dict] = list()
for i,endpoint_id in enumerate(request.link_endpoint_ids):
endpoint_topology_uuid, _, endpoint_uuid = endpoint_get_uuid(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment