Ejemplo n.º 1
0
 def test_0001_list_task(self):
     task_obj = Task(self.client)
     status_list = [TaskStatus.ERROR.value]
     records = task_obj.list_tasks(filter_status_list=status_list)
     n = len(list(records))
     self.logger.debug('found %s tasks' % n)
     assert n > 0
Ejemplo n.º 2
0
def list_tasks(ctx, status):
    try:
        client = ctx.obj['client']
        task_obj = Task(client)
        records = task_obj.list_tasks(filter_status_list=status)
        result = []
        for r in records:
            result.append(
                to_dict(r,
                        attributes=[
                            'name', 'status', 'objectName', 'ownerName',
                            'orgName', 'startDate', 'serviceNamespace', 'id'
                        ]))
        stdout(result, ctx, show_id=True)
    except Exception as e:
        stderr(e, ctx)
Ejemplo n.º 3
0
def list_tasks(ctx, status):
    try:
        restore_session(ctx)
        client = ctx.obj['client']
        task_obj = Task(client)
        records = task_obj.list_tasks(filter_status_list=status)
        result = []
        for r in records:
            result.append(
                to_dict(
                    r,
                    attributes=[
                        'name', 'status', 'objectName', 'ownerName', 'orgName',
                        'startDate', 'serviceNamespace', 'id'
                    ]))
        stdout(result, ctx, show_id=True)
    except Exception as e:
        stderr(e, ctx)