예제 #1
0
    def check_required_distributions(self, resource_value):
        """
        Returns True if this allocator can support the specified required
        distributions.

        resource_value: list
            List of Distributions.
        """
        required = [dist.as_requirement() for dist in resource_value]
        not_avail = check_requirements(sorted(required)) #, logger=self._logger)
        if not_avail:  # Distribution not found or version conflict.
            return (-2, {'required_distributions' : not_avail})
        return (0, None)
예제 #2
0
    def check_required_distributions(self, resource_value):
        """
        Returns True if this allocator can support the specified required
        distributions.

        resource_value: list
            List of Distributions or Requirements.
        """
        required = []
        for item in resource_value:
            if isinstance(item, pkg_resources.Distribution):
                required.append(item.as_requirement())
            else:
                required.append(item)
        not_avail = check_requirements(sorted(required))  # , logger=self._logger)
        if not_avail:  # Distribution not found or version conflict.
            return (-2, {"required_distributions": not_avail})
        return (0, None)