Michael Pasternak has uploaded a new change for review.

Change subject: cli: move warning output to the terminal formatting
......................................................................

cli: move warning output to the terminal formatting

Change-Id: I9e185f269b7eaec194e864d20bc24cacfdcf5a52
Signed-off-by: Michael pasternak <[email protected]>
---
M src/cli/context.py
1 file changed, 13 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-cli refs/changes/63/21263/1

diff --git a/src/cli/context.py b/src/cli/context.py
index 8845fe1..1701673 100644
--- a/src/cli/context.py
+++ b/src/cli/context.py
@@ -291,17 +291,24 @@
 
         @param e: exception
         """
-        sys.stdout.write(
-             ColorHelper.colorize(
-                 '\n+++++++++++++++++ WARNING +++++++++++++++++\n%s\n\n'
-                  %
-                  self.__error_to_string(e),
+
+        text = self.formatter.format_terminal(
+                          text=self.__error_to_string(e).strip(),
+                          border='=',
+                          termwidth=self.terminal._get_width(),
+                          newline="\n",
+                          header='WARNING'
+        )
+
+        text = ColorHelper.colorize(
+                  text,
                   ColorHelper.YELLOW if self.mode != ExecutionMode.SCRIPT
                                         and self.interactive
                                      else None
-              )
         )
 
+        sys.stdout.write(text + "\n")
+
     def _pint_text(self, text, file=sys.stdout):  # @ReservedAssignment
         """
         prints text to output device


-- 
To view, visit http://gerrit.ovirt.org/21263
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e185f269b7eaec194e864d20bc24cacfdcf5a52
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Michael Pasternak <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to