From 5e831b5f5057b97b211f782ee518f2cd3c9bc54a Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 13 Dec 2019 13:31:51 +0100 Subject: [PATCH] Reformatting output of error message on execution --- lib/cr_tf/handler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cr_tf/handler.py b/lib/cr_tf/handler.py index 06ea238..9f217cd 100644 --- a/lib/cr_tf/handler.py +++ b/lib/cr_tf/handler.py @@ -2834,13 +2834,13 @@ class CreateTerraformHandler(BaseHandler): cmd, may_simulate=True, timeout=tf_timeout, stdout=PIPE, stderr=PIPE, check=True) except CalledProcessError as e: - msg = _("Error on executing {cmd!r}: return value {v}.").format( - cmd=e.cmd, v=e.returncode) +# msg = _("Error on executing {cmd!r}: return value {v}.").format( +# cmd=e.cmd, v=e.returncode) if e.stdout: - msg += '\nOutput: {}'.format(e.stdout) + print(self.colored("Output", 'AQUA') + ':\n' + e.stdout) if e.stderr: - msg += '\nError message: {}'.format(e.stderr) - raise ExpectedHandlerError(msg) + print(self.colored("Error message", ('BOLD', 'RED')) + ':\n' + e.stderr) + raise ExpectedHandlerError(str(e)) LOG.debug(_("Completed process:") + "\n" + str(result)) -- 2.39.5