Bug 962582 - Ensure compatibility with requests >= 1.0
Summary: Ensure compatibility with requests >= 1.0
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: tests
Version: 0.12
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: 0.13
Assignee: Nick Coghlan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-14 00:53 UTC by Nick Coghlan
Modified: 2018-02-06 00:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-25 06:26:24 UTC
Embargoed:


Attachments (Terms of Use)

Description Nick Coghlan 2013-05-14 00:53:54 UTC
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-14 01:02:51 UTC
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-14 03:35:36 UTC
(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-27 02:53:43 UTC
(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 06:26:24 UTC
Beaker 0.13.1 has been released.


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