libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: Update cURL lines to include proxy basic auth information (if available).
Date Wed, 20 Aug 2014 18:52:24 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk a03e9f31d -> 816f3705e


Update cURL lines to include proxy basic auth information (if available).


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/816f3705
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/816f3705
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/816f3705

Branch: refs/heads/trunk
Commit: 816f3705ef7b274844363e8315e56ccf1f1cb8c7
Parents: a03e9f31
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Wed Aug 20 20:14:49 2014 +0200
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Wed Aug 20 20:14:49 2014 +0200

----------------------------------------------------------------------
 libcloud/common/base.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/816f3705/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index ae0e699..07647b2 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -345,8 +345,14 @@ class LoggingConnection():
         cmd = ["curl"]
 
         if self.http_proxy_used:
-            proxy_url = 'http://%s:%s' % (self.proxy_host,
-                                          self.proxy_port)
+            if self.proxy_username and self.proxy_password:
+                proxy_url = 'http://%s:%s@%s:%s' % (self.proxy_username,
+                                                    self.proxy_password,
+                                                    self.proxy_host,
+                                                    self.proxy_port)
+            else:
+                proxy_url = 'http://%s:%s' % (self.proxy_host,
+                                              self.proxy_port)
             proxy_url = pquote(proxy_url)
             cmd.extend(['--proxy', proxy_url])
 


Mime
View raw message