From: Frank Brehm Date: Fri, 13 Dec 2019 12:31:51 +0000 (+0100) Subject: Reformatting output of error message on execution X-Git-Tag: 1.4.1~3 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=5e831b5f5057b97b211f782ee518f2cd3c9bc54a;p=pixelpark%2Fcreate-terraform.git Reformatting output of error message on execution --- 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))