def list(self, **kwargs):

        task_list = db.task_list()

        deployments = Deployment().list()

        for x in task_list:
            x["duration"] = x["updated_at"] - x["created_at"]
            # ugly mapping
            for d in deployments:
                if x['deployment_uuid'] == d['uuid']:
                    x._deployment = d

            try:
                source, results = self.report(x['uuid'])
                scenarios = []
                services = []
                for sc in json.loads(source).keys():
                    services.append(sc.split('.')[0])
                    scenarios.append(sc.split('.')[1])
                x['services'] = ', '.join(services)
                x['scenarios'] = ', '.join(scenarios)
                x['_results'] = results
            except Exception as e:
                raise e

        return task_list
예제 #2
0
    def destroy(self, deployment=None):
        """Destroy existing deployment.

        This will delete all ovs sandboxes created during Rally deployment
        creation. Also it will remove the deployment record from the
        Rally database.

        :param deployment: UUID or name of the deployment
        """
        dep = objects.Deployment.get(deployment)
        tasks = db.task_list(deployment=dep["uuid"])
        for task in tasks:
            api.Task.delete(task["uuid"], True)

        api.Deployment.destroy(deployment)
예제 #3
0
    def destroy(self, deployment=None):
        """Destroy existing deployment.

        This will delete all ovs sandboxes created during Rally deployment
        creation. Also it will remove the deployment record from the
        Rally database.

        :param deployment: UUID or name of the deployment
        """
        dep = objects.Deployment.get(deployment)
        tasks = db.task_list(deployment=dep["uuid"])
        for task in tasks:
            api.Task.delete(task["uuid"], True)


        api.Deployment.destroy(deployment)
예제 #4
0
파일: test_api.py 프로젝트: plomakin/rally
 def get_uuids(status=None, deployment=None):
     tasks = db.task_list(status=status, deployment=deployment)
     return sorted(task["uuid"] for task in tasks)
예제 #5
0
파일: test_api.py 프로젝트: plomakin/rally
 def test_task_list_empty(self):
     self.assertEqual([], db.task_list())
예제 #6
0
파일: task.py 프로젝트: lihaijing/rally
 def list(status=None, deployment=None):
     return [Task(db_task) for db_task in db.task_list(status, deployment)]
예제 #7
0
 def list(status=None, deployment=None, tags=None, uuids_only=False):
     return [
         Task(db_task) for db_task in db.task_list(
             status, env=deployment, tags=tags, uuids_only=False)
     ]
예제 #8
0
파일: task.py 프로젝트: sen0120/rally-1
 def list(status=None, deployment=None, tags=None):
     return [
         Task(db_task) for db_task in db.task_list(
             status, deployment=deployment, tags=tags)
     ]
예제 #9
0
 def get_uuids(status=None, deployment=None):
     tasks = db.task_list(status=status, deployment=deployment)
     return sorted(task["uuid"] for task in tasks)
예제 #10
0
 def test_task_list_empty(self):
     self.assertEqual([], db.task_list())
예제 #11
0
파일: test_api.py 프로젝트: fetahi/rally
 def get_uuids(status=None, env=None):
     tasks = db.task_list(status=status, env=env)
     return sorted(task["uuid"] for task in tasks)
예제 #12
0
파일: rallyd.py 프로젝트: dkalashnik/rallyd
def list_tasks():
    return flask.jsonify({"tasks": [i._as_dict() for i in db.task_list()]})
예제 #13
0
 def get_uuids(status=None, env=None):
     tasks = db.task_list(status=status, env=env)
     return sorted(task["uuid"] for task in tasks)
예제 #14
0
파일: task.py 프로젝트: openstack/rally
 def list(status=None, deployment=None, tags=None, uuids_only=False):
     return [Task(db_task) for db_task in db.task_list(
         status, env=deployment, tags=tags, uuids_only=False)]