unit test failing on python-webob 1.2

Bug #984042 reported by Ionuț Arțăriși
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Ionuț Arțăriși

Bug Description

The following unit test fails on a more recent version of python-webob 1.2b3 (vs. devstack's 1.0.8). This is because in newer versions of python-webob, there is only one valid representation for a Response object, which is an AppIterRange object [1] (the tests currently assume a list)

[1] https://github.com/Pylons/webob/commit/0ff6ba6dcde2357369f4073e9986c3212c623239

======================================================================
ERROR: test_object_GET_Range (test.unit.common.middleware.test_swift3.TestSwift3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/openstack-swift-test/test/unit/common/middleware/test_swift3.py", line 478, in test_object_GET_Range
    resp = local_app(req.environ, local_app.app.do_start_response)
  File "/var/lib/openstack-swift-test/swift/common/middleware/swift3.py", line 479, in __call__
    res = getattr(controller, req.method)(env, start_response)
  File "/var/lib/openstack-swift-test/swift/common/middleware/swift3.py", line 378, in GET
    return self.GETorHEAD(env, start_response)
  File "/var/lib/openstack-swift-test/swift/common/middleware/swift3.py", line 339, in GETorHEAD
    app_iter = self.app(env, self.do_start_response)
  File "/var/lib/openstack-swift-test/test/unit/common/middleware/test_swift3.py", line 151, in __call__
    return iter.pop()
AttributeError: 'AppIterRange' object has no attribute 'pop'

Revision history for this message
Ionuț Arțăriși (mapleoin) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (stable/essex)

Fix proposed to branch: stable/essex
Review: https://review.openstack.org/6619

Revision history for this message
Ionuț Arțăriși (mapleoin) wrote :

I believe this is a cleaner fix than the one in master, since I see no reason to return the first element in that IterRange anyway. This will also make the code look identical in both branches. All the tests run fine without it.

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

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

Changed in swift:
assignee: nobody → Ionuț Arțăriși (iartarisi)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/6620
Committed: http://github.com/openstack/swift/commit/c82c719f9327fbeeac147c10507897216936cac8
Submitter: Jenkins
Branch: master

commit c82c719f9327fbeeac147c10507897216936cac8
Author: Ionuț Arțăriși <email address hidden>
Date: Tue Apr 17 18:27:38 2012 +0300

    return the full response from FakeAppObject

    Fixes bug 984042

    Change-Id: I18a6eac497b24338af4d82a568484b0fc9d97382

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.5.0
status: Fix Committed → Fix Released
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.