← Back to team overview

openstack team mailing list archive

Nova trunk completely broken on Python 2.6

 

As of the following changeset, Nova trunk is completely broken on Python 2.6.  I presume that we're still supporting 2.6?  (We better had be!)


commit 035b43b1fd320008234e066e30629fb0e359b424
Author: Naveed Massjouni <naveedm9@xxxxxxxxx>
Date:   Thu Jan 12 18:38:21 2012 +0000

    Refactoring logging _log function.

    We should not be overriding private functions of core python modules.
    Fixes bug: 915597

    Change-Id: I1d1f6dc142cd822030a671f7f2f477a44acafe46


The problem is that the code calls super(NovaLogger, self), but NovaLogger inherits from logging.Logger which is a basic-style class on Python 2.6, and so you can't call super on it.

I mainly raise this on the mailing list because I thought that we might want to revert this for now, in case things get a bit flaming-torches-and-pitchforks.  I can propose one of a few fixes (or someone can beat me to it):

1. Remove all the calls to super, replacing them with explicitly named calls to logging.Logger.
2. Declare NovaLogger as class NovaLogger(logging.Logger, object), which I've not tried but I which presume works.
3. As 2, but conditional on Python 2.6.

Any preferences?

While I'm here, any chance we can have a unit test running on Python 2.6?

Cheers,

Ewan.


Follow ups