diff --git a/src/device/service/Tools.py b/src/device/service/Tools.py index 149b4d5327566d509d0d552c028eb3a3bc4b3698..f8b1113e4979f533ec20c4847f5e4d063bae92ca 100644 --- a/src/device/service/Tools.py +++ b/src/device/service/Tools.py @@ -21,8 +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 google.protobuf import json_format from .driver_api._Driver import _Driver, RESOURCE_ENDPOINTS from .monitoring.MonitoringLoops import MonitoringLoops from .ErrorMessages import ( @@ -195,9 +193,9 @@ def populate_endpoints( device_endpoint.kpi_sample_types.append(kpi_sample_type) monitoring_loops.add_resource_key(device_uuid, endpoint_uuid, kpi_sample_type, monitor_resource_key) - location = resource_value.get('location', {}) - if location: - json_format.Parse(json.dumps(location), device_endpoint.endpoint_location) + location = resource_value.get('location', None) + if location is not None: + device_endpoint.endpoint_location.MergeFrom(Location(**location)) elif resource_key.startswith('/links/link'): # create sub-link