Dan Kenigsberg has posted comments on this change.
Change subject: jsonrpc: Implement the JsonRPC server for the next-gen API ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(6 inline comments)
I have really minor issue, I'm setting -1 for visibility.
p.s. please note that now that you've added the directory under pep8 wings, I get
vdsm_api/process-schema.py:37:1: E302 expected 2 blank lines, found 1
.................................................... Commit Message Line 10: over a JsonRPC wire protocol. The basic format of a message is: Line 11: Line 12: <size><json-data> Line 13: Line 14: <size> is an unsigned 64 bit integer in big endian format that indicates the I would love to hear your motivation for using this kind of packet-splitting of a stream, over using newline as a separator. I thought that the textual nature of json is better maintained with the latter. Line 15: length of <json-data> in bytes. <json-data> is either a request or a response Line 16: in Javascript object notation (JSON). Line 17: Line 18: A request object has the following fields:
.................................................... File Makefile.am Line 17: # Line 18: # Refer to the README and COPYING files for full details of the license Line 19: # Line 20: Line 21: SUBDIRS = vdsm vdsm_cli vds_bootstrap vdsm_reg vdsm_hooks tests vdsm-tool vdsm_api backslash, maybe? Line 22: Line 23: include $(top_srcdir)/build-aux/Makefile.subs Line 24: Line 25: # This is an *exception*, we ship also vdsm.spec so it's possible to build the
.................................................... File tests/apiTests.py Line 37: apiWhitelist = ('StorageDomain.Classes', 'StorageDomain.Types', Line 38: 'Volume.Formats', 'Volume.Types', 'Volume.Roles', 'Image.DiskTypes') Line 39: Line 40: Line 41: def getFakeAPI(): As this function returns None, the "get" prefix is a bit misleading. Line 42: """ Line 43: Create a Mock API module for testing. Mock API will return data from Line 44: the _fakeret global variable instead of calling into vdsm. _fakeret is Line 45: expected to have the following format:
Line 60: def default(self, *args, **kwargs): Line 61: try: Line 62: return _fakeret[self.type][self.lastFunc].pop(0) Line 63: except (KeyError, IndexError): Line 64: raise Exception("No API data avilable for %s.%s" % \ Saggi agreed to a general "Exception"?
redundant trailing backslash Line 65: (self.type, self.lastFunc)) Line 66: Line 67: def __getattr__(self, name): Line 68: # While we are constructing the API module, use the normal getattr
Line 159: _fakeret = {} Line 160: Line 161: Line 162: class JsonRawTest(APITest): Line 163: _Size = struct.Struct("!Q") to me, a function pair of packsize/unpacksize would have been more intuitive. Line 164: Line 165: def buildMessage(self, data): Line 166: msg = json.dumps(data) Line 167: msg = msg.encode('utf-8')
.................................................... File vdsm_api/Bridge.py Line 1: # VDSM API Connector Naming issue: is this a Connector, or a Bridge? and why is the leading Upercase? Line 2: # Copyright (C) 2012 Adam Litke, IBM Corporation Line 3: # Line 4: # This program is free software; you can redistribute it and/or modify Line 5: # it under the terms of the GNU General Public License version 2 as
-- To view, visit http://gerrit.ovirt.org/8614 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Idae0faa80ffc6a5af002a8a7151aa40dc9a6673d Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com