pungi/bin/pungi-notification-report-progress
Lubomír Sedlář 31ef7736aa orchestrator: Monitor status of parts
When a phase is started or stopped, add a line to the to output. This
should help users keep track of what is happening in case the part takes
a long time to run.

JIRA: COMPOSE-3287
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-03-25 14:20:04 +01:00

26 lines
642 B
Python
Executable File

#!/usr/bin/env python
from __future__ import print_function
import argparse
import json
import os
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('cmd')
opts = parser.parse_args()
data = json.load(sys.stdin)
compose = data["location"]
dest = os.environ["_PUNGI_ORCHESTRATOR_PROGRESS_MONITOR"]
with open(dest, "a") as f:
if opts.cmd == "phase-start":
print("%s: phase %s started" % (compose, data["phase_name"]), file=f)
elif opts.cmd == "phase-stop":
print("%s: phase %s finished" % (compose, data["phase_name"]), file=f)