Beispiel #1
0
    def _acquire_resource(self):
        """
    Compute and return with the Single BiS-BiS view based on the global view.

    :return: single BiSBiS representation of the global view
    :rtype: :class:`NFFG`
    """
        dov = self.global_view.get_resource_info()
        if dov.is_empty():
            # DoV is not initialized yet! Probably only just remote Mgrs has been
            # enabled! return with the default empty DoV
            log.warning(
                "Requested global resource view is empty! Return the default empty "
                "topology!")
            return dov
        else:
            if str(self.sbb_id).startswith('$'):
                if str(self.sbb_id)[1:] in os.environ:
                    self.sbb_id = os.environ.get(str(self.sbb_id)[1:])
                    log.debug("Detected SBB id from environment variable: %s" %
                              self.sbb_id)
            # Generate the Single BiSBiS representation
            sbb = NFFGToolBox.generate_SBB_representation(nffg=dov,
                                                          sbb_id=self.sbb_id,
                                                          log=log)
            log.log(VERBOSE, "Generated SBB:\n%s" % sbb.dump())
            return sbb
Beispiel #2
0
    def _acquire_resource(self):
        """
    Compute and return with the Single BiS-BiS view based on the global view.

    :return: single BiSBiS representation of the global view
    :rtype: :any:`NFFG`
    """
        dov = self.global_view.get_resource_info()
        if dov.is_empty():
            # DoV is not initialized yet! Probably only just remote Mgrs has been
            # enabled! return with the default empty DoV
            log.warning(
                "Requested global resource view is empty! Return the default empty "
                "topology!")
            return dov
        else:
            # Generate the Single BiSBiS representation
            return NFFGToolBox.generate_SBB_representation(nffg=dov, log=log)
Beispiel #3
0
    def _acquire_resource(self):
        """
    Compute and return with the Single BiS-BiS view based on the global view.

    :return: single BiSBiS representation of the global view
    :rtype: :class:`NFFG`
    """
        dov = self.global_view.get_resource_info()
        if dov.is_empty():
            # DoV is not initialized yet! Probably only just remote Mgrs has been
            # enabled! return with the default empty DoV
            log.warning(
                "Requested global resource view is empty! Return the default empty "
                "topology!")
            return dov
        else:
            filtered_dov = self.__filter_external_domains(nffg=dov)
            # Generate the Single BiSBiS representation
            sbb = NFFGToolBox.generate_SBB_representation(nffg=filtered_dov,
                                                          log=log)
            log.log(VERBOSE, "Generated SBB:\n%s" % sbb.dump())
            return sbb