Skip to content
Snippets Groups Projects
Commit 6d9323aa authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component:

- Minor code cleanup before merging
parent 8eac01b3
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!89First implementation of location-aware services
...@@ -21,8 +21,6 @@ from common.proto.device_pb2 import MonitoringSettings ...@@ -21,8 +21,6 @@ from common.proto.device_pb2 import MonitoringSettings
from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.proto.kpi_sample_types_pb2 import KpiSampleType
from common.tools.grpc.ConfigRules import update_config_rule_custom from common.tools.grpc.ConfigRules import update_config_rule_custom
from common.tools.grpc.Tools import grpc_message_to_json 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 .driver_api._Driver import _Driver, RESOURCE_ENDPOINTS
from .monitoring.MonitoringLoops import MonitoringLoops from .monitoring.MonitoringLoops import MonitoringLoops
from .ErrorMessages import ( from .ErrorMessages import (
...@@ -195,9 +193,9 @@ def populate_endpoints( ...@@ -195,9 +193,9 @@ def populate_endpoints(
device_endpoint.kpi_sample_types.append(kpi_sample_type) device_endpoint.kpi_sample_types.append(kpi_sample_type)
monitoring_loops.add_resource_key(device_uuid, endpoint_uuid, kpi_sample_type, monitor_resource_key) monitoring_loops.add_resource_key(device_uuid, endpoint_uuid, kpi_sample_type, monitor_resource_key)
location = resource_value.get('location', {}) location = resource_value.get('location', None)
if location: if location is not None:
json_format.Parse(json.dumps(location), device_endpoint.endpoint_location) device_endpoint.endpoint_location.MergeFrom(Location(**location))
elif resource_key.startswith('/links/link'): elif resource_key.startswith('/links/link'):
# create sub-link # create sub-link
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment