From 33f71796220e72d975e990c12dddfda0250a63ea Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Tue, 31 Jan 2023 11:27:10 +0000
Subject: [PATCH] Device component:

- EmulatedDriver: Corrected REG-EX expression
- Removed unneeded import
---
 src/device/service/Tools.py                           | 2 +-
 src/device/service/drivers/emulated/EmulatedDriver.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/device/service/Tools.py b/src/device/service/Tools.py
index af7a8e282..c17bed0b7 100644
--- a/src/device/service/Tools.py
+++ b/src/device/service/Tools.py
@@ -21,7 +21,6 @@ from common.proto.device_pb2 import MonitoringSettings
 from common.proto.kpi_sample_types_pb2 import KpiSampleType
 from common.tools.grpc.ConfigRules import update_config_rule_custom
 from common.tools.grpc.Tools import grpc_message_to_json
-from context.client.ContextClient import ContextClient
 from .driver_api._Driver import _Driver, RESOURCE_ENDPOINTS
 from .monitoring.MonitoringLoops import MonitoringLoops
 from .Errors import (
@@ -145,6 +144,7 @@ def _raw_config_rules_to_grpc(
 def populate_config_rules(device : Device, driver : _Driver) -> List[str]:
     device_uuid = device.device_id.device_uuid.uuid
     results_getconfig = driver.GetConfig()
+    LOGGER.warning('results_getconfig = {:s}'.format(str(results_getconfig)))
     return _raw_config_rules_to_grpc(
         device_uuid, device.device_config, ERROR_GET, ConfigActionEnum.CONFIGACTION_SET, results_getconfig)
 
diff --git a/src/device/service/drivers/emulated/EmulatedDriver.py b/src/device/service/drivers/emulated/EmulatedDriver.py
index 4f5effce0..5d2ac6d03 100644
--- a/src/device/service/drivers/emulated/EmulatedDriver.py
+++ b/src/device/service/drivers/emulated/EmulatedDriver.py
@@ -29,7 +29,7 @@ from .Tools import compose_resource_endpoint
 
 LOGGER = logging.getLogger(__name__)
 
-RE_GET_ENDPOINT_FROM_INTERFACE = re.compile(r'.*\/interface\[([^\]]+)\].*')
+RE_GET_ENDPOINT_FROM_INTERFACE = re.compile(r'^\/interface\[([^\]]+)\].*')
 
 HISTOGRAM_BUCKETS = (
     # .005, .01, .025, .05, .075, .1, .25, .5, .75, 1.0, INF
-- 
GitLab