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
Example #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)
    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)
Example #4
0
 def get_uuids(status=None, deployment=None):
     tasks = db.task_list(status=status, deployment=deployment)
     return sorted(task["uuid"] for task in tasks)
Example #5
0
 def test_task_list_empty(self):
     self.assertEqual([], db.task_list())
Example #6
0
 def list(status=None, deployment=None):
     return [Task(db_task) for db_task in db.task_list(status, deployment)]
Example #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)
     ]
Example #8
0
 def list(status=None, deployment=None, tags=None):
     return [
         Task(db_task) for db_task in db.task_list(
             status, deployment=deployment, tags=tags)
     ]
Example #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)
Example #10
0
 def test_task_list_empty(self):
     self.assertEqual([], db.task_list())
Example #11
0
 def get_uuids(status=None, env=None):
     tasks = db.task_list(status=status, env=env)
     return sorted(task["uuid"] for task in tasks)
Example #12
0
def list_tasks():
    return flask.jsonify({"tasks": [i._as_dict() for i in db.task_list()]})
Example #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)
Example #14
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)]