Change in vdsm[master]: bridge: obtain method

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Mon Feb 15 08:58:14 UTC 2016


Piotr Kliczewski has posted comments on this change.

Change subject: bridge: obtain method
......................................................................


Patch Set 1:

(4 comments)

https://gerrit.ovirt.org/#/c/53472/1/vdsm/rpc/Bridge.py
File vdsm/rpc/Bridge.py:

Line 108:             return response[member]
Line 109:         except KeyError:
Line 110:             raise VdsmError(5, "Response is missing '%s' member" % member)
Line 111: 
Line 112:     def get_method(self, method):
> I would use better name like "dispatch".
Done
Line 113:         try:
Line 114:             (className, methodName) = method.split('.')
Line 115:             self.api['commands'][className][methodName]
Line 116:         except (KeyError):


Line 110:             raise VdsmError(5, "Response is missing '%s' member" % member)
Line 111: 
Line 112:     def get_method(self, method):
Line 113:         try:
Line 114:             (className, methodName) = method.split('.')
> You just introduced a bug fix by Adam few month ago. When using split, you 
Done
Line 115:             self.api['commands'][className][methodName]
Line 116:         except (KeyError):
Line 117:             raise ValueError("Method %s.%s not found"
Line 118:                              % (className, methodName))


Line 112:     def get_method(self, method):
Line 113:         try:
Line 114:             (className, methodName) = method.split('.')
Line 115:             self.api['commands'][className][methodName]
Line 116:         except (KeyError):
> What if name does not contain "."? 
Done
Line 117:             raise ValueError("Method %s.%s not found"
Line 118:                              % (className, methodName))
Line 119:         return partial(self._dynamicMethod, className, methodName)
Line 120: 


Line 114:             (className, methodName) = method.split('.')
Line 115:             self.api['commands'][className][methodName]
Line 116:         except (KeyError):
Line 117:             raise ValueError("Method %s.%s not found"
Line 118:                              % (className, methodName))
> Raising ValueError instead of AttributeError is behavior change. Is this in
Will improve exception hierarchy and start using it.
Line 119:         return partial(self._dynamicMethod, className, methodName)
Line 120: 
Line 121:     def _convertClassName(self, name):
Line 122:         """


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9b6cb53d8e42335510e34dfe372c1c21b80ac219
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list