diff --git a/src/common/tools/descriptor/Loader.py b/src/common/tools/descriptor/Loader.py index 1e238510c98b83bebde8167711b988d7476e5a99..916a73d300011c62fc008fc7437df8a71f6a9838 100644 --- a/src/common/tools/descriptor/Loader.py +++ b/src/common/tools/descriptor/Loader.py @@ -85,6 +85,7 @@ class DescriptorLoader: service_client : Optional[ServiceClient] = None, slice_client : Optional[SliceClient] = None ) -> None: if (descriptors is None) == (descriptors_file is None): + # pylint: disable=broad-exception-raised raise Exception('Exactly one of "descriptors" or "descriptors_file" is required') if descriptors_file is not None: @@ -238,8 +239,13 @@ class DescriptorLoader: self._process_descr('service', 'add', self.__ctx_cli.SetService, Service, self.__services ) self._process_descr('slice', 'add', self.__ctx_cli.SetSlice, Slice, self.__slices ) self._process_descr('connection', 'add', self.__ctx_cli.SetConnection, Connection, self.__connections ) - self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) - self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + + # Update context and topology is useless: + # - devices and links are assigned to topologies automatically by Context component + # - topologies, services, and slices are assigned to contexts automatically by Context component + #self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) + #self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + #self.__ctx_cli.close() def _load_normal_mode(self) -> None: @@ -265,8 +271,12 @@ class DescriptorLoader: self._process_descr('service', 'update', self.__svc_cli.UpdateService, Service, self.__services ) self._process_descr('slice', 'add', self.__slc_cli.CreateSlice, Slice, self.__slices_add ) self._process_descr('slice', 'update', self.__slc_cli.UpdateSlice, Slice, self.__slices ) - self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) - self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + + # Update context and topology is useless: + # - devices and links are assigned to topologies automatically by Context component + # - topologies, services, and slices are assigned to contexts automatically by Context component + #self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) + #self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) #self.__slc_cli.close() #self.__svc_cli.close()