libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1416086 - /libcloud/trunk/libcloud/compute/drivers/vcloud.py
Date Sun, 02 Dec 2012 00:27:41 GMT
Author: tomaz
Date: Sun Dec  2 00:27:41 2012
New Revision: 1416086

URL: http://svn.apache.org/viewvc?rev=1416086&view=rev
Log:
Add vCloud Director v5.1 compatibility via the existing vCloud driver. The
existing v1.5 API driver is compatible with vCloud Director v5.1 using this
patch.

Contributed by Sengor Kusturica, part of LICLOUD-263.

Modified:
    libcloud/trunk/libcloud/compute/drivers/vcloud.py

Modified: libcloud/trunk/libcloud/compute/drivers/vcloud.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/vcloud.py?rev=1416086&r1=1416085&r2=1416086&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/vcloud.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/vcloud.py Sun Dec  2 00:27:41 2012
@@ -806,6 +806,15 @@ class TerremarkDriver(VCloudNodeDriver):
 
 
 class VCloud_1_5_Connection(VCloudConnection):
+    def _get_auth_headers(self):
+        """Compatibility for using v1.5 API under vCloud Director 5.1"""
+        return {
+            'Authorization': "Basic %s" % base64.b64encode(
+                b('%s:%s' % (self.user_id, self.key))).decode('utf-8'),
+            'Content-Length': '0',
+            'Accept': 'application/*+xml;version=1.5'
+        }
+
     def _get_auth_token(self):
         if not self.token:
             # Log In



Mime
View raw message