Change in vdsm[ovirt-3.6]: betterAsyncore: Fix AttributeError on disconnect

fromani at redhat.com fromani at redhat.com
Mon Oct 19 13:03:31 UTC 2015


Francesco Romani has submitted this change and it was merged.

Change subject: betterAsyncore: Fix AttributeError on disconnect
......................................................................


betterAsyncore: Fix AttributeError on disconnect

Recently we added logging when SSLError is raised during recv(), which
happens when a client disconnects in an unclean way. Unfortunately,
logging the error raises an AttributeError and fail to close the
connection as intended:

    >>> from yajsonrpc.betterAsyncore import Dispatcher
    >>> d = Dispatcher()
    >>> d.log.error("message")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'function' object has no attribute 'error'

Dispatcher.log is a method, not a logger instance.

This patches adds a "vds.dispatcher" logger and use it to log the
message.

Since this is an expected event, and logging error and warnings is also
duplicated to the system log, we use now info message.

Change-Id: I84387711167de39ea9364f0717f23ba4aa95edf5
Bug-Url: https://bugzilla.redhat.com/1272496
Backport: 3.6
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/47406
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Reviewed-on: https://gerrit.ovirt.org/47421
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Tested-by: Francesco Romani <fromani at redhat.com>
---
M lib/yajsonrpc/betterAsyncore.py
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I84387711167de39ea9364f0717f23ba4aa95edf5
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken 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: automation at ovirt.org


More information about the vdsm-patches mailing list