]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Reformatting output of error message on execution
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 13 Dec 2019 12:31:51 +0000 (13:31 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 13 Dec 2019 12:31:51 +0000 (13:31 +0100)
lib/cr_tf/handler.py

index 06ea23817d6d91962dbfeae7387aa7f99e3f4f12..9f217cdecf81f05c9da132be421e8ac2f480d160 100644 (file)
@@ -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))