Add support for certificate files to the logging connection.

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

Branch: refs/heads/trunk
Commit: 013afd6ac2e46db2e2731aa3ad404bf1fa377af1
Parents: ac8872d
Author: Tomaz Muraus <[email protected]>
Authored: Sun Apr 5 13:25:57 2015 +0200
Committer: Tomaz Muraus <[email protected]>
Committed: Sun Apr 5 13:25:57 2015 +0200

----------------------------------------------------------------------
 libcloud/common/base.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/013afd6a/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index b5c9ec6..15a3539 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -376,6 +376,11 @@ class LoggingConnection():
         for h in headers:
             cmd.extend(["-H", pquote("%s: %s" % (h, headers[h]))])
 
+        cert_file = getattr(self, 'cert_file', None)
+
+        if cert_file:
+            cmd.extend(["--cert", pquote(cert_file)])
+
         # TODO: in python 2.6, body can be a file-like object.
         if body is not None and len(body) > 0:
             cmd.extend(["--data-binary", pquote(body)])

Reply via email to