Browse Source

Properly format messages coming out of emitPlaybookBanner

In I7e34206d7968bf128e140468b9a222ecbce3a8f1 we modified how
messages are printed for the playbook banner (and now, footer).

The message wasn't formatted properly due to the lack of assignment.
Additionally, we need to add a line break after these messages,
otherwise the next message starts on the same line.

Change-Id: I808d8908815ffa5fae409e600308dfb9ff9c6e77
changes/35/510135/2
David Moreau-Simard 5 years ago
parent
commit
10a9b34f9e
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
  1. 10
      zuul/executor/server.py

10
zuul/executor/server.py

@ -1759,15 +1759,15 @@ class AnsibleJob(object):
if result is not None:
result = self.RESULT_MAP[result]
msg = "{phase} {step} {result}: [{trusted} : {playbook}@{branch}]"
msg.format(phase=phase, step=step, result=result,
trusted=trusted, playbook=playbook, branch=branch)
msg = msg.format(phase=phase, step=step, result=result,
trusted=trusted, playbook=playbook, branch=branch)
else:
msg = "{phase} {step}: [{trusted} : {playbook}@{branch}]"
msg.format(phase=phase, step=step, trusted=trusted,
playbook=playbook, branch=branch)
msg = msg.format(phase=phase, step=step, trusted=trusted,
playbook=playbook, branch=branch)
with open(self.jobdir.job_output_file, 'a') as job_output:
job_output.write("{now} | {msg}".format(
job_output.write("{now} | {msg}\n".format(
now=datetime.datetime.now(),
msg=msg))

Loading…
Cancel
Save