Change in vdsm[ovirt-3.6]: hooks: moving hook error to exception module

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Tue Feb 2 11:55:39 UTC 2016


Piotr Kliczewski has uploaded a new change for review.

Change subject: hooks: moving hook error to exception module
......................................................................

hooks: moving hook error to exception module


Required-For: https://bugzilla.redhat.com/1295778
Change-Id: I920a7ecff2f5e0b604f8c13dce2e59bdeef30056
Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
---
M lib/vdsm/exception.py
M vdsm/hooks.py
2 files changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/52983/1

diff --git a/lib/vdsm/exception.py b/lib/vdsm/exception.py
index dd3fd97..71b9de0 100644
--- a/lib/vdsm/exception.py
+++ b/lib/vdsm/exception.py
@@ -29,3 +29,8 @@
 
     def response(self):
         return {'status': {'code': self.code, 'message': str(self)}}
+
+
+class HookError(VdsmException):
+    code = 1500
+    message = "Hook Error"
diff --git a/vdsm/hooks.py b/vdsm/hooks.py
index 45068a2..4197083 100644
--- a/vdsm/hooks.py
+++ b/vdsm/hooks.py
@@ -30,11 +30,8 @@
 import sys
 import tempfile
 
+from vdsm import exception
 from vdsm.constants import P_VDSM_HOOKS, P_VDSM
-
-
-class HookError(Exception):
-    pass
 
 
 # dir path is relative to '/' for test purposes
@@ -108,7 +105,7 @@
                 logging.warn('hook returned unexpected return code %s', rc)
 
         if errorSeen and raiseError:
-            raise HookError(err)
+            raise exception.HookError(err)
 
         with open(data_filename) as f:
             final_data = f.read()


-- 
To view, visit https://gerrit.ovirt.org/52983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I920a7ecff2f5e0b604f8c13dce2e59bdeef30056
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>


More information about the vdsm-patches mailing list