Commit eb074ab1 authored by Daniele Venzano's avatar Daniele Venzano

Do not emit any output if there no executions to list (simplifies scripting)

parent 7dc288c7
......@@ -106,6 +106,8 @@ def exec_list_cmd(auth, args):
if key in filter_names:
filters[key] = value
data = exec_api.list(**filters)
if len(data) == 0:
return
tabular_data = [[e['id'], e['name'], e['user_id'], e['status']] for e in sorted(data.values(), key=lambda x: x['id'])]
headers = ['ID', 'Name', 'User ID', 'Status']
print(tabulate(tabular_data, headers))
......
......@@ -77,6 +77,8 @@ def exec_list_cmd(auth, args):
if key in filter_names:
filters[key] = value
data = exec_api.list(**filters)
if len(data) == 0:
return
tabular_data = [[e['id'], e['name'], e['user_id'], e['status']] for e in sorted(data.values(), key=lambda x: x['id'])]
headers = ['ID', 'Name', 'User ID', 'Status']
print(tabulate(tabular_data, headers))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment