Jiří Moskovčák has uploaded a new change for review.

Change subject: print more user friendly error when VM is powered down while 
running collectors
......................................................................

print more user friendly error when VM is powered down while running collectors

The stacktrace will still get logged, but there will be human readable
reason why it happened. Please note that this situation is rare so we shouldn't
have problems with log floods

Change-Id: I027b090a785883f79c7a678e8505c7e1d18bf2a8
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1170512
Signed-off-by: Jiri Moskovcak <jmosk...@redhat.com>
---
M mom/HypervisorInterfaces/vdsmInterface.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/mom refs/changes/83/35883/1

diff --git a/mom/HypervisorInterfaces/vdsmInterface.py 
b/mom/HypervisorInterfaces/vdsmInterface.py
index 1193785..208ad21 100644
--- a/mom/HypervisorInterfaces/vdsmInterface.py
+++ b/mom/HypervisorInterfaces/vdsmInterface.py
@@ -220,8 +220,12 @@
 
 class vdsmException(Exception):
 
-    def __init__(self, msg, logger):
-        self.msg = msg
+    def __init__(self, response, logger):
+        self.msg = response
+        try:
+            self.msg = response['status'].get('message', response)
+        except:
+            pass
         self.logger = logger
 
     def handle_exception(self):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I027b090a785883f79c7a678e8505c7e1d18bf2a8
Gerrit-PatchSet: 1
Gerrit-Project: mom
Gerrit-Branch: master
Gerrit-Owner: Jiří Moskovčák <jmosk...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to