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

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Thu Feb 18 11:06:53 UTC 2016


Hello Yaniv Bronhaim, Francesco Romani,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/53699

to review the following change.

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>
Reviewed-on: https://gerrit.ovirt.org/52983
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.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/99/53699/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/53699
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.3
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>


More information about the vdsm-patches mailing list