Change in vdsm[master]: jsonrpc: events

ykaplan at redhat.com ykaplan at redhat.com
Sun Jun 7 09:32:10 UTC 2015


Yeela Kaplan has posted comments on this change.

Change subject: jsonrpc: events
......................................................................


Patch Set 31: Code-Review-1

(4 comments)

https://gerrit.ovirt.org/#/c/38069/31/lib/yajsonrpc/stompreactor.py
File lib/yajsonrpc/stompreactor.py:

Line 288: subscribed
/s/subscribes which subscribed/subscribers


Line 285:                                 self._reactor)
Line 286: 
Line 287:     """
Line 288:     Sends message to all subscribes which subscribed to destination.
Line 289:     If destination is not provided we use default destination.
destination part is quite self explanatory, I think we can remove second line of comment and let the code explain itself...
Line 290:     """
Line 291:     def send(self, message, destination=_DEFAULT_RESPONSE_DESTINATION):
Line 292:         self.log.debug("Sending response")
Line 293:         try:


https://gerrit.ovirt.org/#/c/38069/31/tests/jsonRpcHelper.py
File tests/jsonRpcHelper.py:

Line 93: 
Line 94:     json_binding = BindingJsonRpc(jsonBridge)
Line 95:     json_binding.start()
Line 96: 
Line 97:     cif.json_binding = json_binding
I think it might be better to add a ctor to FakeClientIf and pass it the json_binding.

so cif will only be created after json_binding.
This allows us to remove line #48 that instantiates cif json_binding to None which seems redundant.
Line 98:     jsonBridge.cif = cif
Line 99: 
Line 100:     stompDetector = StompDetector(json_binding)
Line 101:     acceptor.add_detector(stompDetector)


https://gerrit.ovirt.org/#/c/38069/31/vdsm/clientIF.py
File vdsm/clientIF.py:

Line 138:     def notify(self, event_id, **kwargs):
Line 139:         """
Line 140:         Send notification using provided subscription id as
Line 141:         event_id and a dictionary as event body. Before sending
Line 142:         there is notify_time added on top level to the dictionary.
Here also,
I think that there are too many details. Following will be enough:
Send notification using provided subscription id and event body.

Whoever needs more details should read Notification code in yajsonrpc.
Line 143:         """
Line 144:         notification = Notification(
Line 145:             event_id,
Line 146:             self._send_notification,


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id27b5ca1773139932eb5cb16921d5abec4991c5e
Gerrit-PatchSet: 31
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.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: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list