Add the compose type to the output from compose status

This commit is contained in:
Brian C. Lane 2018-03-22 16:27:12 -07:00
parent 423e8cba88
commit c15f3c89fa

View File

@ -73,12 +73,13 @@ def compose_status(socket_path, api_version, args, show_json=False, testmode=0):
return {"id": compose["id"],
"recipe": compose["recipe"],
"version": compose["version"],
"compose_type": compose["compose_type"],
"status": compose["queue_status"]}
# Sort the status in a specific order
def sort_status(a):
order = ["RUNNING", "WAITING", "FINISHED", "FAILED"]
return (order.index(a["status"]), a["recipe"], a["version"])
return (order.index(a["status"]), a["recipe"], a["version"], a["compose_type"])
status = []
@ -106,7 +107,7 @@ def compose_status(socket_path, api_version, args, show_json=False, testmode=0):
# Print them as UUID RECIPE STATUS
for c in status:
print("%s %-8s %-15s %s" % (c["id"], c["status"], c["recipe"], c["version"]))
print("%s %-8s %-15s %s %s" % (c["id"], c["status"], c["recipe"], c["version"], c["compose_type"]))
def compose_types(socket_path, api_version, args, show_json=False, testmode=0):