Bug 962582 - Ensure compatibility with requests >= 1.0
Ensure compatibility with requests >= 1.0
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: tests (Show other bugs)
0.12
Unspecified Unspecified
medium Severity unspecified (vote)
: 0.13
: ---
Assigned To: Nick Coghlan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-13 20:53 EDT by Nick Coghlan
Modified: 2013-06-25 02:26 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-25 02:26:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nick Coghlan 2013-05-13 20:53:54 EDT
The requests module included a few backwards incompatible API changes in its transition to 1.0. Beaker (or at least the test suite) currently doesn't run correctly on Fedora 17+, as it assumes the old (pre-1.0) requests API, while Fedora ships the newer version:

$ rpm -q python-requests
python-requests-1.1.0-3.fc17.noarch

This will also involve packaging the now separate https://pypi.python.org/pypi/requests-kerberos/ as an RPM

======================================================================
ERROR: test_system_export_reimport (bkr.inttest.server.selenium.test_csv_roundtrip.CSVRoundtripTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ncoghlan/rhdevel/beaker/IntegrationTests/src/bkr/inttest/server/selenium/test_csv_roundtrip.py", line 48, in test_system_export_reimport
    self.import_csv(''.join([row for row in self.get_csv('system')]))
  File "/home/ncoghlan/rhdevel/beaker/IntegrationTests/src/bkr/inttest/server/selenium/test_csv_roundtrip.py", line 41, in get_csv
    request = requests.get(url, cookies=cookies, prefetch=False)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 55, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
TypeError: request() got an unexpected keyword argument 'prefetch'

======================================================================
ERROR: test_log_delete_expired (bkr.inttest.server.tools.test_log_delete.LogDelete)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ncoghlan/rhdevel/beaker/IntegrationTests/src/bkr/inttest/server/tools/test_log_delete.py", line 123, in test_log_delete_expired
    log_delete.log_delete()
  File "/home/ncoghlan/rhdevel/beaker/Server/bkr/server/tools/log_delete.py", line 59, in log_delete
    auth=requests.auth.HTTPKerberosAuth(require_mutual_auth=False))
AttributeError: 'module' object has no attribute 'HTTPKerberosAuth'
Comment 1 Amit Saha 2013-05-13 21:02:51 EDT
Regarding the 'prefetch' error, in a couple of tests, we have statements like these:

request = requests.get(url, cookies=cookies, prefetch=False)

which is hitting the API change. This can be fixed by replacing it with:

request = requests.get(url, cookies=cookies, stream=True)

(I can't seem to be able to find the changelog which explained the change)
Comment 2 Dan Callaghan 2013-05-13 23:35:36 EDT
(In reply to comment #0)
> This will also involve packaging the now separate
> https://pypi.python.org/pypi/requests-kerberos/ as an RPM

Package review for python-requests-kerberos is bug 962612.
Comment 7 Dan Callaghan 2013-05-26 22:53:43 EDT
(In reply to Dan Callaghan from comment #6)

Sorry, ignore this. requests was not upgraded. It's working now.

It is probably a mistake in the packaging of requests-kerberos that it doesn't require newer requests. I will fix that.
Comment 9 Amit Saha 2013-06-25 02:26:24 EDT
Beaker 0.13.1 has been released.

Note You need to log in before you can comment on or make changes to this bug.