Change in vdsm[master]: hooks: make sure that hook error inherits from vdsm exception

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Sat Jan 9 07:10:52 UTC 2016


Piotr Kliczewski has posted comments on this change.

Change subject: hooks: make sure that hook error inherits from vdsm exception
......................................................................


Patch Set 2:

(4 comments)

https://gerrit.ovirt.org/#/c/51549/2/lib/vdsm/hooks.py
File lib/vdsm/hooks.py:

Line 28: import os.path
Line 29: import sys
Line 30: import tempfile
Line 31: 
Line 32: from . import exception, utils
> Use one line per import
Done
Line 33: from .constants import P_VDSM_HOOKS, P_VDSM
Line 34: 
Line 35: 
Line 36: class HookError(exception.GeneralException):


Line 32: from . import exception, utils
Line 33: from .constants import P_VDSM_HOOKS, P_VDSM
Line 34: 
Line 35: 
Line 36: class HookError(exception.GeneralException):
> We need a code attribute, otherwise on the engine we will see a GeneralExce
OK, let's add codes for hooks. So far the hook issues were general execptions.
Line 37:     message = "Hook Error"
Line 38: 
Line 39: 
Line 40: # dir path is relative to '/' for test purposes


https://gerrit.ovirt.org/#/c/51549/2/vdsm/rpc/Bridge.py
File vdsm/rpc/Bridge.py:

Line 283
Line 284
Line 285
Line 286
Line 287
> In a future patch, we should kill this block, and change all the apis to ra
Agree


Line 282:             except TypeError as e:
Line 283:                 self.log.exception("TypeError raised by dispatched function")
Line 284:                 raise InvalidCall(fn, methodArgs, e)
Line 285:             except VdsmException as e:
Line 286:                 raise yajsonrpc.JsonRpcError(e.code, str(e))
> We need a test for this change.
Done
Line 287: 
Line 288:         if result['status']['code']:
Line 289:             code = result['status']['code']
Line 290:             msg = result['status']['message']


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9c0e953f96827737eede22ab39a1f7689c30944
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list