Merge lp:~zulcss/python-keystoneclient/fix-requests-2 into lp:~openstack-ubuntu-testing/python-keystoneclient/grizzly

Proposed by Chuck Short
Status: Merged
Approved by: Yolanda Robla
Approved revision: 51
Merged at revision: 51
Proposed branch: lp:~zulcss/python-keystoneclient/fix-requests-2
Merge into: lp:~openstack-ubuntu-testing/python-keystoneclient/grizzly
Diff against target: 126 lines (+112/-3)
1 file modified
debian/patches/fix-requests-requirements.patch (+112/-3)
To merge this branch: bzr merge lp:~zulcss/python-keystoneclient/fix-requests-2
Reviewer Review Type Date Requested Status
Yolanda Robla (community) Approve
Review via email: mp+146887@code.launchpad.net

Description of the change

More complete fix.

To post a comment you must log in.
Revision history for this message
Yolanda Robla (yolanda.robla) wrote :

Looks good to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/patches/fix-requests-requirements.patch'
--- debian/patches/fix-requests-requirements.patch 2013-02-05 15:59:46 +0000
+++ debian/patches/fix-requests-requirements.patch 2013-02-06 16:05:01 +0000
@@ -1,6 +1,112 @@
1diff -Naurp python-keystoneclient.orig/tools/pip-requires python-keystoneclient/tools/pip-requires1From cfb84dd5c6c3d66c6ccc5818f4338b027f8eff44 Mon Sep 17 00:00:00 2001
2--- python-keystoneclient.orig/tools/pip-requires 2013-02-05 09:58:02.814039981 -06002From: Chuck Short <chuck.short@canonical.com>
3+++ python-keystoneclient/tools/pip-requires 2013-02-05 09:58:19.802040386 -06003Date: Wed, 6 Feb 2013 09:36:51 -0600
4Subject: [PATCH] Allow requests up to 1.1
5
6The requests module dropped all configuration with the 1.0.0 release.
7There's no danger_mode and no 'verbose'' mode. The former
8shouldn't be necessary anymore and the latter can be done by setting
9a different log handler for the request.logging root logger.
10
11Signed-off-by: Chuck Short <chuck.short@canonical.com>
12---
13 keystoneclient/client.py | 7 +------
14 tests/test_shell.py | 3 +--
15 tests/utils.py | 2 --
16 tests/v3/utils.py | 2 --
17 tools/pip-requires | 2 +-
18 5 files changed, 3 insertions(+), 13 deletions(-)
19
20diff --git a/keystoneclient/client.py b/keystoneclient/client.py
21index 77e8b3c..94617b7 100644
22--- a/keystoneclient/client.py
23+++ b/keystoneclient/client.py
24@@ -50,10 +50,6 @@ class HTTPClient(object):
25
26 USER_AGENT = 'python-keystoneclient'
27
28- requests_config = {
29- 'danger_mode': False,
30- }
31-
32 def __init__(self, username=None, tenant_id=None, tenant_name=None,
33 password=None, auth_url=None, region_name=None, timeout=None,
34 endpoint=None, token=None, cacert=None, key=None,
35@@ -121,7 +117,7 @@ class HTTPClient(object):
36 ch = logging.StreamHandler()
37 _logger.setLevel(logging.DEBUG)
38 _logger.addHandler(ch)
39- self.requests_config['verbose'] = sys.stderr
40+ requests.logging.getLogger(requests.__name__).addHandler(ch)
41
42 # keyring setup
43 self.use_keyring = use_keyring and keyring_available
44@@ -336,7 +332,6 @@ class HTTPClient(object):
45 method,
46 url,
47 verify=self.verify_cert,
48- config=self.requests_config,
49 **request_kwargs)
50
51 self.http_log_resp(resp)
52diff --git a/tests/test_shell.py b/tests/test_shell.py
53index 695fe02..4de4a2c 100644
54--- a/tests/test_shell.py
55+++ b/tests/test_shell.py
56@@ -327,8 +327,7 @@ class ShellTest(utils.TestCase):
57 request_mock.assert_called_with(mock.ANY, mock.ANY,
58 timeout=2,
59 headers=mock.ANY,
60- verify=mock.ANY,
61- config=mock.ANY)
62+ verify=mock.ANY)
63
64 def test_do_endpoints(self):
65 do_shell_mock = mock.MagicMock()
66diff --git a/tests/utils.py b/tests/utils.py
67index 6e8dbaf..9d9bf8d 100644
68--- a/tests/utils.py
69+++ b/tests/utils.py
70@@ -17,7 +17,6 @@ class TestCase(testtools.TestCase):
71 TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
72 TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v2.0')
73 TEST_REQUEST_BASE = {
74- 'config': {'danger_mode': False},
75 'verify': True,
76 }
77
78@@ -94,7 +93,6 @@ class UnauthenticatedTestCase(testtools.TestCase):
79 TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
80 TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v2.0')
81 TEST_REQUEST_BASE = {
82- 'config': {'danger_mode': False},
83 'verify': True,
84 }
85
86diff --git a/tests/v3/utils.py b/tests/v3/utils.py
87index e2a1412..bfb3861 100644
88--- a/tests/v3/utils.py
89+++ b/tests/v3/utils.py
90@@ -40,7 +40,6 @@ class TestCase(testtools.TestCase):
91 TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
92 TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v3')
93 TEST_REQUEST_BASE = {
94- 'config': {'danger_mode': False},
95 'verify': True,
96 }
97
98@@ -70,7 +69,6 @@ class UnauthenticatedTestCase(testtools.TestCase):
99 TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
100 TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v3')
101 TEST_REQUEST_BASE = {
102- 'config': {'danger_mode': False},
103 'verify': True,
104 }
105
106diff --git a/tools/pip-requires b/tools/pip-requires
107index f93089e..f9cc6e8 100644
108--- a/tools/pip-requires
109+++ b/tools/pip-requires
4@@ -1,5 +1,5 @@110@@ -1,5 +1,5 @@
5 argparse111 argparse
6 iso8601>=0.1.4112 iso8601>=0.1.4
@@ -8,3 +114,6 @@
8-requests>=0.8.8,<1.0114-requests>=0.8.8,<1.0
9+requests>=0.8.8,<=1.1115+requests>=0.8.8,<=1.1
10 simplejson116 simplejson
117--
1181.8.1.2
119

Subscribers

People subscribed via source and target branches