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

Service component - MicroWave service handler

- corrected service resource keys
- corrected endpoint count in set/delete endpoint methods
parent 8962a9c2
No related branches found
No related tags found
2 merge requests!54Release 2.0.0,!36Performance Evaluation Framework + Helper Tools
......@@ -81,7 +81,7 @@ class MicrowaveServiceHandler(_ServiceHandler):
device_uuid = endpoints[0][0]
device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
json_config_rule = json_config_rule_set('/service[{:s}]'.format(service_uuid), {
json_config_rule = json_config_rule_set('/services/service[{:s}]'.format(service_uuid), {
'uuid' : service_uuid,
'node_id_src': node_id_src,
'tp_id_src' : tp_id_src,
......@@ -111,11 +111,13 @@ class MicrowaveServiceHandler(_ServiceHandler):
results = []
try:
chk_type('endpoints', endpoints, list)
if len(endpoints) != 2: raise Exception('len(endpoints) != 2')
if len(endpoints) < 1: raise Exception('len(endpoints) < 1')
device_uuid = endpoints[0][0]
device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
json_config_rule = json_config_rule_delete('/service[{:s}]'.format(service_uuid), {'uuid': service_uuid})
json_config_rule = json_config_rule_delete('/services/service[{:s}]'.format(service_uuid), {
'uuid': service_uuid
})
del device.device_config.config_rules[:]
device.device_config.config_rules.append(ConfigRule(**json_config_rule))
self.__task_executor.configure_device(device)
......
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