Attempt to call strftime on a str fails revocation_list

Bug #1285871 reported by Steve Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Steve Baker

Bug Description

This causes heat authenticated operations to fail for me locally

2014-02-28 10:25:10.084 ERROR keystone.common.wsgi [-] 'str' object has no attribute 'strftime'
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi Traceback (most recent call last):
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi File "/home/steveb/dev/localstack/keystone/keystone/common/wsgi.py", line 211, in __call__
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi result = method(context, **params)
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi File "/home/steveb/dev/localstack/keystone/keystone/openstack/common/versionutils.py", line 102, in wrapped
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi return func(*args, **kwargs)
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi File "/home/steveb/dev/localstack/keystone/keystone/common/controller.py", line 131, in inner
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi return f(self, context, *args, **kwargs)
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi File "/home/steveb/dev/localstack/keystone/keystone/token/controllers.py", line 423, in revocation_list
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi t['expires'] = timeutils.isotime(expires)
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi File "/home/steveb/dev/localstack/keystone/keystone/openstack/common/timeutils.py", line 38, in isotime
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi st = at.strftime(_ISO8601_TIME_FORMAT
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi AttributeError: 'str' object has no attribute 'strftime'
2014-02-28 10:25:10.084 TRACE keystone.common.wsgi

Possibly the six.text_type check should be six.string_types, but actually that conditional should really be checking for isinstance datetime.datetime explicitly, since that is what timeutils.isotime is assuming.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
assignee: nobody → Steve Baker (steve-stevebaker)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/76977
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=a6840be9ac09cca334a37b8ab84c71679581d45e
Submitter: Jenkins
Branch: master

commit a6840be9ac09cca334a37b8ab84c71679581d45e
Author: Steve Baker <email address hidden>
Date: Fri Feb 28 10:29:12 2014 +1300

    revocation_list only call isotime on datetime objects

    If expires is a str then isinstance six.text_type is false then the following
    exception is raised:
    AttributeError: 'str' object has no attribute 'strftime'

    This change explicitly checks for a datetime object, which is what
    timeutils.isotime expects.

    Change-Id: I8012f96498fffe5f54e7f1ca08b7beb6fa168f9c
    Closes-Bug: #1285871

Changed in keystone:
status: In Progress → Fix Committed
Dolph Mathews (dolph)
Changed in keystone:
milestone: none → icehouse-rc1
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-rc1 → 2014.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to keystone (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/235487

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by David Stanek (<email address hidden>) on branch: master
Review: https://review.openstack.org/235487
Reason: No activity. If anyone wants to work on this, fell free to re-open.

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.