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