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
This commit is contained in:
David Moreau-Simard 2017-10-06 10:21:26 -04:00
parent 07cbaee770
commit 10a9b34f9e
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
1 changed files with 5 additions and 5 deletions

View File

@ -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,
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,
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))