@classmethod
    def validate_tasks(cls, tasks, cluster, graph_type):
        """Check that passed tasks are present in deployment graph.

        :param tasks: list of tasks
        :type tasks: list[dict]
        :param cluster: Cluster DB object
        :type cluster: models.Cluster
        :param graph_type: Deployment graph type
        :type graph_type: basestring
        :returns: list of tasks
        :rtype: list[dict]
        """
        cls.validate_schema(tasks, base_types.STRINGS_ARRAY)

        deployment_tasks = objects.Cluster.get_deployment_tasks(
            cluster, graph_type)
        graph = orchestrator_graph.GraphSolver()
        graph.add_tasks(deployment_tasks)

        non_existent_tasks = set(graph.nodes()) - set(tasks)
        if non_existent_tasks:
            raise errors.InvalidData(
                'Tasks {0} are not present in deployment graph'.format(
                    ','.join(non_existent_tasks)))

        return tasks
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/api/v1/validators/orchestrator_graph.py/TaskDeploymentValidator.validate_tasks/swapped operands of `-`