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

Proposed by Chuck Short on 2013-02-06
Status: Merged
Approved by: Yolanda Robla on 2013-02-06
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 2013-02-06 Approve on 2013-02-06
Review via email: mp+146887@code.launchpad.net

Description of the change

More complete fix.

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

Subscribers

People subscribed via source and target branches