From f7c4c3f5d57607a0442b28794bdf4465c0163759 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 7 Aug 2018 14:05:53 -0700 Subject: [PATCH] Add job_* timestamp support to compose status --- src/composer/cli/compose.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/composer/cli/compose.py b/src/composer/cli/compose.py index 327c07b1..e8d87303 100644 --- a/src/composer/cli/compose.py +++ b/src/composer/cli/compose.py @@ -126,7 +126,9 @@ def compose_status(socket_path, api_version, args, show_json=False, testmode=0): "compose_type": compose["compose_type"], "image_size": compose["image_size"], "status": compose["queue_status"], - "timestamp": compose["timestamp"]} + "created": compose.get("job_created"), + "started": compose.get("job_started"), + "finished": compose.get("job_finished")} # Sort the status in a specific order def sort_status(a): @@ -164,7 +166,7 @@ def compose_status(socket_path, api_version, args, show_json=False, testmode=0): else: image_size = "" - dt = datetime.fromtimestamp(c["timestamp"]) + dt = datetime.fromtimestamp(c.get("finished") or c.get("started") or c.get("created")) print("%s %-8s %s %-15s %s %-16s %s" % (c["id"], c["status"], dt.strftime("%c"), c["blueprint"], c["version"], c["compose_type"], image_size))