Fix python26 compatibility for RFCSysLogHandler

Bug #1306559 reported by Bogdan Dobrelya
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Unassigned
Glance
Fix Released
Low
Pranesh
Murano
Fix Released
Low
Steve McLellan
OpenStack Identity (keystone)
Fix Released
Low
Unassigned
neutron
Fix Released
Low
Unassigned

Bug Description

Currently used pattern https://review.openstack.org/#/c/63094/15/openstack/common/log.py (lines 471-479) will fail for Python 2.6.x.
In order to fix the broken Python 2.6.x compatibility, old style explicit superclass method calls should be used instead.

Here is an example of how to check this for Python v2.7 and v2.6:
import logging.handlers
print type(logging.handlers.SysLogHandler)
print type(logging.Handler)

Results would be:
Python 2.7: <type 'type'>, so super() may be used for RFCSysLogHandler(logging.handlers.SysLogHandler)
Python 2.6:<type 'classobj'>, so super() may *NOT* be used for RFCSysLogHandler(logging.handlers.SysLogHandler)

Tags: log
summary: - Fix python26 compatibility forRFCSysLogHandler
+ Fix python26 compatibility for RFCSysLogHandler
Changed in nova:
assignee: nobody → Bogdan Dobrelya (bogdando)
status: New → In Progress
tags: added: log
Changed in nova:
assignee: Bogdan Dobrelya (bogdando) → nobody
status: In Progress → Confirmed
Changed in ceilometer:
status: New → Confirmed
Changed in cinder:
status: New → Confirmed
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :
Changed in glance:
status: New → Confirmed
Changed in keystone:
status: New → Confirmed
Changed in sahara:
status: New → Confirmed
Changed in heat:
status: New → Confirmed
Changed in murano:
status: New → Confirmed
Changed in neutron:
status: New → Confirmed
Changed in oslo:
assignee: nobody → Bogdan Dobrelya (bogdando)
status: New → In Progress
description: updated
Changed in murano:
importance: Undecided → Low
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/86875
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=f61a4e72ad71b03a89860f553e693932596dd811
Submitter: Jenkins
Branch: master

commit f61a4e72ad71b03a89860f553e693932596dd811
Author: Bogdan Dobrelya <email address hidden>
Date: Fri Apr 11 14:56:46 2014 +0300

    Fix python26 compatibility for RFCSysLogHandler

    1)Currently used pattern will fail for Python 2.6.x.
    In order to fix the broken Python 2.6.x compatibility,
    old style explicit superclass method calls should be used instead.
    Here is an example of how to check this for Python v2.7 and v2.6:
      import logging.handlers
      print type(logging.handlers.SysLogHandler)
      print type(logging.Handler)
    Results would be:
      Python 2.7: <type 'type'>, so super() may be used for
        RFCSysLogHandler(logging.handlers.SysLogHandler)
      Python 2.6:<type 'classobj'>, so super() may *NOT* be used.
    2)Add unit tests for standard and RFC-wrapped format handlers.

    Closes-bug: #1306559

    Change-Id: Ib93daac4c3bd72107074be3df64005af1ff18acb
    Signed-off-by: Bogdan Dobrelya <email address hidden>

Changed in oslo:
status: In Progress → Fix Committed
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Medium
status: Confirmed → Triaged
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Low
Changed in oslo:
importance: Undecided → Low
Steve McLellan (sjmc7)
Changed in murano:
assignee: nobody → Steve McLellan (sjmc7)
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to murano-api (master)

Fix proposed to branch: master
Review: https://review.openstack.org/92398

Changed in murano:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano-api (master)

Reviewed: https://review.openstack.org/92398
Committed: https://git.openstack.org/cgit/stackforge/murano-api/commit/?id=3ba00c25e180f3a13292fcd7d90f4522be984898
Submitter: Jenkins
Branch: master

commit 3ba00c25e180f3a13292fcd7d90f4522be984898
Author: Steve McLellan <email address hidden>
Date: Tue May 6 10:57:08 2014 -0500

    Fixed python2.6 compat for RFCSysLogHandler

    (From the original bug report):
    Currently used pattern in RFCSysLogHandler will fail for Python
    2.6.x (using super(RFCSysLogHandler, self)).
    In order to fix the broken Python 2.6.x compatibility, old style
    explicit superclass method calls should be used instead.

    Uses e.g. logging.handlers.SysLogHandler.__init__(self,...)
    rather than super(RFCSysLogHandler, self).__init__(...)

    Change-Id: Ia81e00e4a7763a887703d0ef83e475f314eab28d
    Closes-Bug: #1306559

Changed in murano:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → juno-1
status: Fix Committed → Fix Released
Changed in sahara:
assignee: nobody → Andrew Lazarev (alazarev)
status: Confirmed → In Progress
importance: Undecided → Low
milestone: none → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sahara (master)

Reviewed: https://review.openstack.org/100015
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=605b03916653fe0399f2bdb71609b1985ae0f5ca
Submitter: Jenkins
Branch: master

commit 605b03916653fe0399f2bdb71609b1985ae0f5ca
Author: Andrew Lazarev <email address hidden>
Date: Fri Jun 13 13:52:50 2014 -0700

    Sync up oslo log module

    Main changes:
    * removed annoying warning about RFCSysLogHandler.super
    * improved password screening
    * default log level for oslo.messaging

    Closes-Bug: #1306559
    Change-Id: I65ebf85e648cd5a1388ea77f6036d1f79f5b335b

Changed in sahara:
status: In Progress → Fix Committed
Revision history for this message
Jeff Peeler (jpeeler-z) wrote :

For heat, this was merged in https://git.openstack.org/cgit/openstack/heat/commit/?id=ea911b0210c4b4317de6bd371c25f5cb9c255655 and has already been released in j1.

Changed in heat:
status: Confirmed → Fix Released
Thierry Carrez (ttx)
Changed in sahara:
status: Fix Committed → Fix Released
Changed in ceilometer:
assignee: nobody → Steve Lewis (steve-lewis)
Revision history for this message
Steve Lewis (steve-lewis) wrote :
Changed in ceilometer:
assignee: Steve Lewis (steve-lewis) → nobody
status: Triaged → Fix Released
Changed in murano:
milestone: none → juno-3
Revision history for this message
Sean Dague (sdague) wrote :

This seems a legit regression of py26 compat, should make sure it's fixed before release.

Changed in nova:
importance: Undecided → High
milestone: none → juno-rc1
Matt Riedemann (mriedem)
no longer affects: nova
Sean Dague (sdague)
no longer affects: sahara
Revision history for this message
Matt Riedemann (mriedem) wrote :

The fix from oslo-incubator was synced to nova with this commit:

https://github.com/openstack/nova/commit/185e4562df47a101cf41d1e66d75de2644c78022

So it's in juno-1.

Revision history for this message
Sean Dague (sdague) wrote :

deleting projects that have fixed this to get around launchpad timeout limitations

no longer affects: oslo-incubator
no longer affects: ceilometer
no longer affects: heat
Revision history for this message
Mark Washenberger (markwash) wrote :

Fixed in glance in 0435a7823bfea87eec0bdd129c532305da6efb19

Changed in glance:
status: Confirmed → Fix Committed
Changed in murano:
status: Fix Committed → Fix Released
Revision history for this message
haruka tanizawa (h-tanizawa) wrote :

In neutron, also synced from oslo .

commit 1730f0016a21c38f7129284e994d56efa9b7df63
Author: Ihar Hrachyshka <email address hidden>
Date: Tue Jun 24 00:29:12 2014 +0200

    Synced log module and its dependencies from olso-incubator

    Old version of 'log' module depended on oslo-incubator RPC layer
    implementation. This sync is intended to copy the following fix that
    makes log module use oslo.messaging.notify.log_handler if available:

      * 109e325e: Use oslo.messaging to publish log errors

    blueprint oslo-messaging

    Change-Id: Ieb26df4e9fbb2aa4d319c79be7510006fc8461ab

Dolph Mathews (dolph)
Changed in glance:
milestone: none → juno-rc1
importance: Undecided → Low
Dolph Mathews (dolph)
Changed in glance:
assignee: nobody → Pranesh (praneshpg)
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Fixed in Cinder in the following commit.

commit bc87669e9adb7a3c3b04927581dcba6c97706612
Author: pran1990 <email address hidden>
Date: Mon May 5 16:07:13 2014 -0700

    Use oslo network utils function to set tcp_keepalive

    [....]

    log.py
    edd73c9 Merge "Improve help strings"
    fe3389e Improve help strings
    8a0f567 Remove str() from LOG.* and exceptions
    f61a4e7 Fix python26 compatibility for RFCSysLogHandler
    da6d713 Revert setting oslo-incubator logs to INFO
    0d18381 Set default log levels for oslo.messaging and oslo-incubator

Changed in neutron:
importance: Undecided → Low
status: Confirmed → Fix Committed
milestone: none → juno-rc1
Changed in cinder:
status: Confirmed → Fix Committed
Revision history for this message
Dolph Mathews (dolph) wrote :

It'd be great to see a fix for this in Keystone if one is still required, but given that our Python 2.6 gate is nearing the end of it's lifecycle, we soon won't have a way to test this before it becomes a Won't Fix issue.

Changed in keystone:
status: Confirmed → Incomplete
Revision history for this message
David Stanek (dstanek) wrote :

It looks like Keystone was fixed quite a while ago: https://review.openstack.org/#/c/87980/

Changed in keystone:
status: Incomplete → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → juno-rc2
Thierry Carrez (ttx)
Changed in cinder:
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-rc2 → none
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: juno-rc1 → 2014.2
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-rc1 → 2014.2
Changed in murano:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.