Comment 2 for bug 1213284

Revision history for this message
Jay Buffington (jaybuff) wrote :

I'm seeing this in master. This bug is actually a *result* of the unified logging in keystone print, which commit 0c2fc69b implements. keystone worked under py26 prior to that commit.

To replicate:

    $ git checkout 0c2fc69b~1
    HEAD is now at 14e0901... Move 'tests' directory into 'keystone' package

    $ python2.6
    Python 2.6.6 (r266:84292, Sep 11 2012, 05:13:24)
    [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from keystone.common import logging
    >>> LOG = logging.getLogger(__name__)
    >>> LOG.isEnabledFor(logging.DEBUG)
    False
    >>>

    $ git checkout 0c2fc69b
    Previous HEAD position was 14e0901... Move 'tests' directory into 'keystone' package
    HEAD is now at 0c2fc69... Refactor Keystone to use unified logging from Oslo

    $ python2.6
    Python 2.6.6 (r266:84292, Sep 11 2012, 05:13:24)
    [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from keystone.openstack.common import log as logging
    >>> LOG = logging.getLogger(__name__)
    >>> LOG.isEnabledFor(LOG.debug)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: ContextAdapter instance has no attribute 'isEnabledFor'
    >>>

I am using the LDAP backend, which uses isEnabledFor:

    $ grep -rI isEnabledFor keystone/*
    keystone/common/ldap/core.py: if LOG.isEnabledFor(LOG.debug):
    keystone/common/ldap/core.py: if LOG.isEnabledFor(LOG.debug):
    keystone/common/ldap/core.py: if LOG.isEnabledFor(LOG.debug):
    keystone/common/wsgi.py: if LOG.isEnabledFor(LOG.debug):
    keystone/common/wsgi.py: if LOG.isEnabledFor(LOG.debug):
    $