Change in vdsm[master]: bridge: obtain method

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Tue Feb 16 10:19:49 UTC 2016


Piotr Kliczewski has posted comments on this change.

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


Patch Set 2:

(4 comments)

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

Line 68
Line 69
Line 70
Line 71
Line 72
> dead code?
The code similar to _dynamicMethod which is wrong and I haven't seen this code being used anywhere.


Line 93:             raise VdsmError(5, "Response is missing '%s' member" % member)
Line 94: 
Line 95:     def dispatch(self, method):
Line 96:         try:
Line 97:             className, methodName = method.split('.')
> split('.', 1)
Done
Line 98:             self.api['commands'][className][methodName]
Line 99:         except (KeyError, ValueError):
Line 100:             raise VdsmError(100, "Method %s.%s not found"
Line 101:                             % (className, methodName))


Line 96:         try:
Line 97:             className, methodName = method.split('.')
Line 98:             self.api['commands'][className][methodName]
Line 99:         except (KeyError, ValueError):
Line 100:             raise VdsmError(100, "Method %s.%s not found"
> VdsmError is not a good choice, and initializing it with an error code is b
OK will change it.
Line 101:                             % (className, methodName))
Line 102:         return partial(self._dynamicMethod, className, methodName)
Line 103: 
Line 104:     def _convertClassName(self, name):


Line 97:             className, methodName = method.split('.')
Line 98:             self.api['commands'][className][methodName]
Line 99:         except (KeyError, ValueError):
Line 100:             raise VdsmError(100, "Method %s.%s not found"
Line 101:                             % (className, methodName))
> Better use the original string provided by the caller.
Done
Line 102:         return partial(self._dynamicMethod, className, methodName)
Line 103: 
Line 104:     def _convertClassName(self, name):
Line 105:         """


-- 
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: 2
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: 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