Commit 1f8f79ea authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Service component - L3NM IETF Slice:

- Fixed delete config rules
parent de5f92a5
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -183,9 +183,22 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler):
                DeviceId(**json_device_id(src_device_uuid))
            )
            controller = self.__task_executor.get_device_controller(src_device_obj)

            datastore_delta = DataStoreDelta(self.__service)
            running_slice = datastore_delta.running_data

            if len(running_slice) != 1:
                MSG = 'Unsupported number of Slices[{:d}]({:s})'
                raise Exception(MSG.format(len(running_slice), str(running_slice)))
            running_slice = running_slice[0]

            slice_data_model = {'network-slice-services': {'slice-service': [{
                'id': running_slice['id'],
            }]}}

            del controller.device_config.config_rules[:]
            controller.device_config.config_rules.append(ConfigRule(**json_config_rule_delete(
                '/service[{:s}]/IETFSlice'.format(service_uuid), {}
                '/service[{:s}]/IETFSlice'.format(service_uuid), slice_data_model
            )))
            self.__task_executor.configure_device(controller)
            results.append(True)