Loading src/device/service/DeviceServiceServicerImpl.py +0 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,6 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): else: t_pop_endpoints = None is_optical_device = request.device_drivers[0] == DeviceDriverEnum.DEVICEDRIVER_OC if len(device.device_config.config_rules) == len(connection_config_rules) and not is_optical_device: # created from request, populate config rules using driver Loading src/device/service/OpenConfigServicer.py +1 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class OpenConfigServicer(DeviceServiceServicer): def AddOpenConfigDevice(self, request : OpticalConfig, context : grpc.ServicerContext) -> DeviceId: device_uuid = request.device_id.device_uuid.uuid check_no_endpoints(request.device_endpoints) context_client = ContextClient() device = get_device(context_client, device_uuid, rw_copy=True) if device is None: Loading @@ -60,7 +61,6 @@ class OpenConfigServicer(DeviceServiceServicer): device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED device.device_drivers.extend(request.device_drivers) # pylint: disable=no-member device.device_config.CopyFrom(request.device_config) #LOGGER.debug(request.device_config) device.device_endpoints.extend(request.device_endpoints) # pylint: disable=no-member device_id = context_client.SetDevice(device) Loading src/device/service/Tools.py +0 −21 Original line number Diff line number Diff line Loading @@ -554,24 +554,3 @@ def extract_resources(config : dict, device : Device) -> list[list[dict], dict]: resources.append({'resource_key': 'upper-frequency', 'value': upper_frequency}) return [resources, conditions] def update_sap_id(device: Device, sap_id: int) -> None: found = False for config_rule in device.device_config.config_rules: if config_rule.WhichOneof('config_rule') == 'custom' and config_rule.custom.resource_key == '_connect/settings': try: settings = json.loads(config_rule.custom.resource_value) except ValueError: settings = {} settings['sap_id'] = str(sap_id) config_rule.custom.resource_value = json.dumps(settings) found = True break if not found: new_rule = device.device_config.config_rules.add() new_rule.action = ConfigActionEnum.CONFIGACTION_SET new_rule.custom.resource_key = '_connect/settings' settings = {'sap_id': str(sap_id)} new_rule.custom.resource_value = json.dumps(settings) No newline at end of file src/device/service/drivers/__init__.py +0 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,6 @@ if LOAD_ALL_DEVICE_DRIVERS: DRIVERS.append( (PON_Driver, [ { # Close enough, it does optical switching FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.PON_CONTROLLER, FilterFieldEnum.DRIVER : DeviceDriverEnum.DEVICEDRIVER_PON, } Loading src/device/service/drivers/openconfig/templates/Interfaces.py +2 −3 Original line number Diff line number Diff line Loading @@ -74,7 +74,6 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: vlan_id = xml_subinterface.find('ocv:vlan/ocv:match/ocv:single-tagged/ocv:config/ocv:vlan-id', namespaces=NAMESPACES) add_value_from_tag(subinterface, 'vlan_id', vlan_id, cast=int) # TODO: implement support for multiple IP addresses per subinterface #ipv4_addresses = [] for xml_ipv4_address in xml_subinterface.xpath(XPATH_IPV4ADDRESSES, namespaces=NAMESPACES): Loading Loading
src/device/service/DeviceServiceServicerImpl.py +0 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,6 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): else: t_pop_endpoints = None is_optical_device = request.device_drivers[0] == DeviceDriverEnum.DEVICEDRIVER_OC if len(device.device_config.config_rules) == len(connection_config_rules) and not is_optical_device: # created from request, populate config rules using driver Loading
src/device/service/OpenConfigServicer.py +1 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class OpenConfigServicer(DeviceServiceServicer): def AddOpenConfigDevice(self, request : OpticalConfig, context : grpc.ServicerContext) -> DeviceId: device_uuid = request.device_id.device_uuid.uuid check_no_endpoints(request.device_endpoints) context_client = ContextClient() device = get_device(context_client, device_uuid, rw_copy=True) if device is None: Loading @@ -60,7 +61,6 @@ class OpenConfigServicer(DeviceServiceServicer): device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED device.device_drivers.extend(request.device_drivers) # pylint: disable=no-member device.device_config.CopyFrom(request.device_config) #LOGGER.debug(request.device_config) device.device_endpoints.extend(request.device_endpoints) # pylint: disable=no-member device_id = context_client.SetDevice(device) Loading
src/device/service/Tools.py +0 −21 Original line number Diff line number Diff line Loading @@ -554,24 +554,3 @@ def extract_resources(config : dict, device : Device) -> list[list[dict], dict]: resources.append({'resource_key': 'upper-frequency', 'value': upper_frequency}) return [resources, conditions] def update_sap_id(device: Device, sap_id: int) -> None: found = False for config_rule in device.device_config.config_rules: if config_rule.WhichOneof('config_rule') == 'custom' and config_rule.custom.resource_key == '_connect/settings': try: settings = json.loads(config_rule.custom.resource_value) except ValueError: settings = {} settings['sap_id'] = str(sap_id) config_rule.custom.resource_value = json.dumps(settings) found = True break if not found: new_rule = device.device_config.config_rules.add() new_rule.action = ConfigActionEnum.CONFIGACTION_SET new_rule.custom.resource_key = '_connect/settings' settings = {'sap_id': str(sap_id)} new_rule.custom.resource_value = json.dumps(settings) No newline at end of file
src/device/service/drivers/__init__.py +0 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,6 @@ if LOAD_ALL_DEVICE_DRIVERS: DRIVERS.append( (PON_Driver, [ { # Close enough, it does optical switching FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.PON_CONTROLLER, FilterFieldEnum.DRIVER : DeviceDriverEnum.DEVICEDRIVER_PON, } Loading
src/device/service/drivers/openconfig/templates/Interfaces.py +2 −3 Original line number Diff line number Diff line Loading @@ -74,7 +74,6 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: vlan_id = xml_subinterface.find('ocv:vlan/ocv:match/ocv:single-tagged/ocv:config/ocv:vlan-id', namespaces=NAMESPACES) add_value_from_tag(subinterface, 'vlan_id', vlan_id, cast=int) # TODO: implement support for multiple IP addresses per subinterface #ipv4_addresses = [] for xml_ipv4_address in xml_subinterface.xpath(XPATH_IPV4ADDRESSES, namespaces=NAMESPACES): Loading