Revision fd48c0cd snf-image-host/host-monitor.py
b/snf-image-host/host-monitor.py | ||
---|---|---|
56 | 56 |
msg['type'] = PROTOCOL[msg_type][0] |
57 | 57 |
|
58 | 58 |
lines = [] |
59 |
while True: |
|
60 |
line = sys.stdin.readline() |
|
59 |
if msg_type == 'stderr': |
|
60 |
msg['stderr'] = sys.stdin.read() |
|
61 |
else: |
|
62 |
while True: |
|
63 |
line = sys.stdin.readline() |
|
61 | 64 |
|
62 |
if not line: |
|
63 |
break |
|
65 |
if not line:
|
|
66 |
break
|
|
64 | 67 |
|
65 |
lines.append(line.strip()) |
|
68 |
lines.append(line.strip()) |
|
69 |
msg[PROTOCOL[msg_type][1]] = lines |
|
66 | 70 |
|
67 |
msg[PROTOCOL[msg_type][1]] = lines |
|
68 | 71 |
msg['timestamp'] = time.time() |
69 | 72 |
sys.stdout.write("%s\n" % json.dumps(msg)) |
70 | 73 |
|
Also available in: Unified diff