Commit b7430bbc authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of https://labs.etsi.org/rep/tfs/controller into feat/device-ietf-l2vpn

parents 04be3bc7 5266289b
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -58,13 +58,11 @@ SERVICE_CONNECTION_POINTS = [
class MockOSMShell(cmd.Cmd):
    intro = 'Welcome to the MockOSM shell.\nType help or ? to list commands.\n'
    prompt = '(mock-osm) '
    file = None

    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)
        self.mock_osm = MockOSM(WIM_URL, WIM_PORT_MAPPING, WIM_USERNAME, WIM_PASSWORD)

    # ----- basic turtle commands -----
    def do_create(self, arg):
        'Create an ELINE (L2) service'
        service_uuid = self.mock_osm.create_connectivity_service(
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ spec:
        - name: LOG_LEVEL
          value: "INFO"
        - name: SLICE_GROUPING
          value: "ENABLE"
          value: "DISABLE"
        envFrom:
        - secretRef:
            name: qdb-data
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ def process_site_network_access(context_client : ContextClient, site_id : str, s
            location_endpoints.setdefault(str_location_id, set()).add(str_endpoint_id)
        num_endpoints_per_location = {len(endpoints) for endpoints in location_endpoints.values()}
        num_disjoint_paths = min(num_endpoints_per_location)
        update_constraint_sla_availability(constraints, num_disjoint_paths, all_active)
        update_constraint_sla_availability(constraints, num_disjoint_paths, all_active, 0.0)

    return target

+4 −4
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ def compose_config_rules_data(
    return dict_config_rules

def upsert_config_rules(
    session : Session, config_rules : List[Dict],
    session : Session, config_rules : List[Dict], is_delete : bool = False,
    device_uuid : Optional[str] = None, service_uuid : Optional[str] = None, slice_uuid : Optional[str] = None,
) -> bool:
    uuids_to_delete : Set[str] = set()
@@ -89,7 +89,9 @@ def upsert_config_rules(
    for config_rule in config_rules:
        configrule_uuid = config_rule['configrule_uuid']
        configrule_action = config_rule['action']
        if configrule_action == ORM_ConfigActionEnum.SET:
        if is_delete or configrule_action == ORM_ConfigActionEnum.DELETE:
            uuids_to_delete.add(configrule_uuid)
        elif configrule_action == ORM_ConfigActionEnum.SET:
            position = uuids_to_upsert.get(configrule_uuid)
            if position is None:
                # if not added, add it
@@ -98,8 +100,6 @@ def upsert_config_rules(
            else:
                # if already added, update occurrence
                rules_to_upsert[position] = config_rule
        elif configrule_action == ORM_ConfigActionEnum.DELETE:
            uuids_to_delete.add(configrule_uuid)
        else:
            MSG = 'Action for ConfigRule({:s}) is not supported '+\
                  '(device_uuid={:s}, service_uuid={:s}, slice_uuid={:s})'
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ def compose_constraints_data(
    return dict_constraints

def upsert_constraints(
    session : Session, constraints : List[Dict],
    session : Session, constraints : List[Dict], is_delete : bool = False,
    service_uuid : Optional[str] = None, slice_uuid : Optional[str] = None
) -> bool:
    uuids_to_upsert : Dict[str, int] = dict()
@@ -111,7 +111,7 @@ def upsert_constraints(
        delete_affected = int(constraint_deletes.rowcount) > 0

    upsert_affected = False
    if len(constraints) > 0:
    if not is_delete and len(constraints) > 0:
        stmt = insert(ConstraintModel).values(constraints)
        stmt = stmt.on_conflict_do_update(
            index_elements=[ConstraintModel.constraint_uuid],
Loading