You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2012/12/02 01:27:41 UTC

svn commit: r1416086 - /libcloud/trunk/libcloud/compute/drivers/vcloud.py

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