Example #1
0
    def __filter_external_domains(nffg):
        """
    Filter out domains detected by external DomainManagers.

    :param nffg: filtered NFFG
    :return: :class:`NFFG`
    """
        log.debug("Filtering domains detected from external DomainManagers...")
        # Get External DomainManager names
        ext_mgr = CONFIG.get_external_managers()
        # Copy NFFG
        filtered_nffg = nffg.copy()
        # Remove the detected domains by External DomainManagers
        for ext in ext_mgr:
            # Get all the domains
            domains = NFFGToolBox.detect_domains(nffg=filtered_nffg)
            # Get domains detected and initiated by the External DomainManager
            ext_domains = [d for d in domains if ext in d]
            # Remove collected domains from NFFG
            for domain in ext_domains:
                log.debug(
                    "Remove domain: %s originated from external DomainManager: %s"
                    % (domain, ext))
                NFFGToolBox.remove_domain(base=filtered_nffg,
                                          domain=domain,
                                          log=log)
        filtered_nffg.name += "-filtered"
        return filtered_nffg
Example #2
0
    def set_global_view(self, nffg):
        """
    Replace the global view with the given topology.

    :param nffg: new global topology
    :type nffg: :any:`NFFG`
    :return: None
    """
        log.debug("Update the whole Global view (DoV) with the NFFG: %s..." %
                  nffg)
        self.dov.update_full_global_view(nffg=nffg)
        self.__tracked_domains.clear()
        self.__tracked_domains.update(NFFGToolBox.detect_domains(nffg))