Commit 16134c8a authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Common - Tools - Descriptor:

- Activated explicit update of topology in loader to add devices/links to topologies
parent bcf209ca
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -240,11 +240,16 @@ class DescriptorLoader:
        self._process_descr('slice',      'add',    self.__ctx_cli.SetSlice,      Slice,      self.__slices        )
        self._process_descr('connection', 'add',    self.__ctx_cli.SetConnection, Connection, self.__connections   )

        # 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
        # By default the Context component automatically assigns devices and links to topologies based on their
        # endpoints, and assigns topologies, services, and slices to contexts based on their identifiers.

        # The following statement is useless; up to now, any use case requires assigning a topology, service, or
        # slice to a different context.
        #self._process_descr('context',    'update', self.__ctx_cli.SetContext,    Context,    self.__contexts      )
        #self._process_descr('topology',   'update', self.__ctx_cli.SetTopology,   Topology,   self.__topologies    )

        # In some cases, it might be needed to assign devices and links to multiple topologies; the
        # following statement performs that assignment.
        self._process_descr('topology',   'update', self.__ctx_cli.SetTopology,   Topology,   self.__topologies    )

        #self.__ctx_cli.close()

@@ -272,11 +277,16 @@ class DescriptorLoader:
        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        )
        
        # 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
        # By default the Context component automatically assigns devices and links to topologies based on their
        # endpoints, and assigns topologies, services, and slices to contexts based on their identifiers.

        # The following statement is useless; up to now, any use case requires assigning a topology, service, or
        # slice to a different context.
        #self._process_descr('context',  'update', self.__ctx_cli.SetContext,      Context,  self.__contexts      )
        #self._process_descr('topology', 'update', self.__ctx_cli.SetTopology,     Topology, self.__topologies    )

        # In some cases, it might be needed to assign devices and links to multiple topologies; the
        # following statement performs that assignment.
        self._process_descr('topology', 'update', self.__ctx_cli.SetTopology,     Topology, self.__topologies    )

        #self.__slc_cli.close()
        #self.__svc_cli.close()