File requests-0.8x-compatibility.diff of Package python-novaclient

commit c73afa9fd1df14bff9186c1e73ac8f3593ef81db
Author: Sascha Peilicke <saschpe@suse.de>
Date:   Mon Jan 21 12:00:54 2013 +0100

    Update to requests >= 0.8
    
    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: Iec169ef6e39097814cdbf1b777bc0590236692ba

diff --git a/novaclient/client.py b/novaclient/client.py
index 225b68d..0e0afeb 100644
--- a/novaclient/client.py
+++ b/novaclient/client.py
@@ -44,10 +44,6 @@ class HTTPClient(object):
 
     USER_AGENT = 'python-novaclient'
 
-    requests_config = {
-        'danger_mode': False,
-    }
-
     def __init__(self, user, password, projectid, auth_url=None,
                  insecure=False, timeout=None, proxy_tenant_id=None,
                  proxy_token=None, region_name=None,
@@ -104,7 +100,8 @@ class HTTPClient(object):
             ch = logging.StreamHandler()
             self._logger.setLevel(logging.DEBUG)
             self._logger.addHandler(ch)
-            self.requests_config['verbose'] = sys.stderr
+            if hasattr(requests, logging):
+                requests.logging.getLogger(requests.__name__).addHandler(ch)
 
     def use_token_cache(self, use_it):
         self.os_cache = use_it
@@ -167,7 +164,6 @@ class HTTPClient(object):
             method,
             url,
             verify=self.verify_cert,
-            config=self.requests_config,
             **kwargs)
         self.http_log_resp(resp)
 
diff --git a/tools/pip-requires b/tools/pip-requires
index 7fbcbbe..ee904d4 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -1,5 +1,5 @@
 argparse
 iso8601>=0.1.4
 prettytable>=0.6,<0.7
-requests<1.0
+requests>=0.8
 simplejson
openSUSE Build Service is sponsored by