Python 3.5 gate exposes issue in webob.response status code type

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

Bug Description

Unit test keystone.tests.unit.test_wsgi.ApplicationTest.test_render_response_custom_status fails with the following error:

ft274.18: keystone.tests.unit.test_wsgi.ApplicationTest.test_render_response_custom_status_StringException: pythonlogging:'': {{{
Adding cache-proxy 'oslo_cache.testing.CacheIsolatingProxy' to backend.
Adding cache-proxy 'oslo_cache.testing.CacheIsolatingProxy' to backend.
Adding cache-proxy 'oslo_cache.testing.CacheIsolatingProxy' to backend.
}}}

Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-keystone-python35-db-nv/.tox/py35/lib/python3.5/site-packages/webob/response.py", line 271, in _status__set
    status_code = int(value.split()[0])
ValueError: invalid literal for int() with base 10: 'HTTPStatus.NOT_IMPLEMENTED'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-keystone-python35-db-nv/keystone/tests/unit/test_wsgi.py", line 110, in test_render_response_custom_status
    status=(http_client.NOT_IMPLEMENTED, 'Not Implemented'))
  File "/home/jenkins/workspace/gate-keystone-python35-db-nv/keystone/common/wsgi.py", line 770, in render_response
    headerlist=headers)
  File "/home/jenkins/workspace/gate-keystone-python35-db-nv/.tox/py35/lib/python3.5/site-packages/webob/response.py", line 107, in __init__
    self.status = status
  File "/home/jenkins/workspace/gate-keystone-python35-db-nv/.tox/py35/lib/python3.5/site-packages/webob/response.py", line 273, in _status__set
    raise ValueError('Invalid status code, integer required.')
ValueError: Invalid status code, integer required.

In some places we pass the status code as a str and others as an int

http://logs.openstack.org/42/339142/2/check/gate-keystone-python35-db-nv/847ed7d/testr_results.html.gz

Eric Brown (ericwb)
Changed in keystone:
assignee: nobody → Eric Brown (ericwb)
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/339214

Changed in keystone:
status: New → In Progress
Changed in keystone:
importance: Undecided → Medium
milestone: none → newton-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

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

commit 88de82e130e25aeff2cf2c0e98159ebce3199d28
Author: Eric Brown <email address hidden>
Date: Thu Jul 7 13:00:43 2016 -0700

    Ensure status code is always passed as int

    There is some inconsistency in calls to the wsgi render_response
    function. Sometimes the status tuple uses an int for the http
    status code and other times a string. The Python 3.5 gate job
    discovered the problem.

    This patch normalizes all calls to use an int.

    Change-Id: I136b01f755ff99dfba244e79068fdaae614b2091
    Closes-Bug: #1599983

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/keystone 10.0.0.0b2

This issue was fixed in the openstack/keystone 10.0.0.0b2 development milestone.

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.