File compat-newer-requests.patch of Package python-keystoneclient

Based on the following commits (but tweaked to apply to this tarball):

commit dd24bcf15c5e690c56619e92b11fd4a340572fb5
Author: Yaguang Tang <yaguang.tang@canonical.com>
Date:   Mon Dec 31 00:31:50 2012 +0800

    Pin requests to >=0.8.8.
    
    requests add SSL CERT VERIFICATION support since 0.8.8.
    fix bug #1094699
    
    Change-Id: I7974983087f7483283438906d738bec7cba84ed2

commit b998ff92527cf542f7e8db127cd65bfc7ccceb1a
Author: Chuck Short <chuck.short@canonical.com>
Date:   Wed Feb 6 09:36:51 2013 -0600

    Allow requests up to 0.8 and greater
    
    The requests module dropped all configuration with the 1.0.0 release.
    There's no danger_mode and no 'verbose'' mode. The former
    shouldn't be necessary anymore and the latter can be done by setting
    a different log handler for the request.logging root logger.
    
    Change-Id: I41bfaf2574f6d7fc21f86e0124ceae7df6481eee
    Signed-off-by: Chuck Short <chuck.short@canonical.com>

diff --git a/tools/pip-requires b/tools/pip-requires
index fab4830..0019f6c 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -1,4 +1,4 @@
 argparse
 prettytable
-requests<1.0
+requests>=0.8.8,<1.0
 simplejson
diff --git a/keystoneclient/client.py b/keystoneclient/client.py
index 0233aeb..14c38b0 100644
--- a/keystoneclient/client.py
+++ b/keystoneclient/client.py
@@ -50,10 +50,6 @@ class HTTPClient(object):
 
     USER_AGENT = 'python-keystoneclient'
 
-    requests_config = {
-        'danger_mode': False,
-    }
-
     def __init__(self, username=None, tenant_id=None, tenant_name=None,
                  password=None, auth_url=None, region_name=None, timeout=None,
                  endpoint=None, token=None, cacert=None, key=None,
@@ -121,7 +117,8 @@ class HTTPClient(object):
             ch = logging.StreamHandler()
             _logger.setLevel(logging.DEBUG)
             _logger.addHandler(ch)
-            self.requests_config['verbose'] = sys.stderr
+            if hasattr(requests, logging):
+                requests.logging.getLogger(requests.__name__).addHandler(ch)
 
         # keyring setup
         self.use_keyring = use_keyring and keyring_available
@@ -336,7 +333,6 @@ class HTTPClient(object):
             method,
             url,
             verify=self.verify_cert,
-            config=self.requests_config,
             **request_kwargs)
 
         self.http_log_resp(resp)
diff --git a/tests/utils.py b/tests/utils.py
index 6e8dbaf..9d9bf8d 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -17,7 +17,6 @@ class TestCase(testtools.TestCase):
     TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
     TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v2.0')
     TEST_REQUEST_BASE = {
-        'config': {'danger_mode': False},
         'verify': True,
     }
 
@@ -94,7 +93,6 @@ class UnauthenticatedTestCase(testtools.TestCase):
     TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
     TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v2.0')
     TEST_REQUEST_BASE = {
-        'config': {'danger_mode': False},
         'verify': True,
     }
 
diff --git a/tests/v3/utils.py b/tests/v3/utils.py
index e2a1412..bfb3861 100644
--- a/tests/v3/utils.py
+++ b/tests/v3/utils.py
@@ -40,7 +40,6 @@ class TestCase(testtools.TestCase):
     TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
     TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v3')
     TEST_REQUEST_BASE = {
-        'config': {'danger_mode': False},
         'verify': True,
     }
 
@@ -70,7 +69,6 @@ class UnauthenticatedTestCase(testtools.TestCase):
     TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
     TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v3')
     TEST_REQUEST_BASE = {
-        'config': {'danger_mode': False},
         'verify': True,
     }
 
diff --git a/tools/pip-requires b/tools/pip-requires
index f93089e..81d0663 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -1,4 +1,4 @@
 argparse
 prettytable
-requests>=0.8.8,<1.0
+requests>=0.8.8
 simplejson
openSUSE Build Service is sponsored by