Commit 167c74f1 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent f15ff137
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -47,7 +47,8 @@ class ServiceNameEnum(Enum):
    COMPUTE       = 'compute'
    CYBERSECURITY = 'cybersecurity'
    INTERDOMAIN   = 'interdomain'
    L3AM          = 'l3-attackmitigator'
    L3_AM         = 'l3-attackmitigator'
    L3_CAD        = 'l3-centralizedattackdetector'
    PATHCOMP      = 'pathcomp'
    WEBUI         = 'webui'

@@ -67,7 +68,8 @@ DEFAULT_SERVICE_GRPC_PORTS = {
    ServiceNameEnum.DLT          .value :  8080,
    ServiceNameEnum.COMPUTE      .value :  9090,
    ServiceNameEnum.CYBERSECURITY.value : 10000,
    ServiceNameEnum.L3AM         .value : 10002,  
    ServiceNameEnum.L3_CAD       .value : 10001,
    ServiceNameEnum.L3_AM        .value : 10002,
    ServiceNameEnum.INTERDOMAIN  .value : 10010,
    ServiceNameEnum.PATHCOMP     .value : 10020,

+2 −2
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@ RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION,

class l3_attackmitigatorClient:
    def __init__(self, host=None, port=None):
        if not host: host = get_service_host(ServiceNameEnum.L3AM)
        if not port: port = get_service_port_grpc(ServiceNameEnum.L3AM)
        if not host: host = get_service_host(ServiceNameEnum.L3_AM)
        if not port: port = get_service_port_grpc(ServiceNameEnum.L3_AM)
        self.endpoint = "{}:{}".format(host, port)
        LOGGER.debug("Creating channel to {}...".format(self.endpoint))
        self.channel = None
+3 −1
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@ from common.proto.l3_attackmitigator_pb2_grpc import (
    L3AttackmitigatorServicer,
)
from common.proto.context_pb2 import (
    Service, ServiceId, ServiceConfig, ServiceTypeEnum, ServiceStatusEnum, ServiceStatus, Context, ContextId, Uuid, Timestamp, ConfigRule, ConfigRule_Custom, ConfigActionEnum, Device, DeviceId, DeviceConfig, DeviceOperationalStatusEnum, DeviceDriverEnum, EndPoint, Link, LinkId, EndPoint, EndPointId, Topology, TopologyId
    Service, ServiceId, ServiceConfig, ServiceTypeEnum, ServiceStatusEnum, ServiceStatus, Context, ContextId, Uuid,
    Timestamp, ConfigRule, ConfigRule_Custom, ConfigActionEnum, Device, DeviceId, DeviceConfig,
    DeviceOperationalStatusEnum, DeviceDriverEnum, EndPoint, Link, LinkId, EndPoint, EndPointId, Topology, TopologyId
)
from common.proto.context_pb2_grpc import (
    ContextServiceStub