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 2013/04/21 20:06:40 UTC

svn commit: r1470326 - in /libcloud/trunk: ./ CHANGES libcloud/storage/drivers/cloudfiles.py libcloud/test/compute/test_deployment.py libcloud/test/storage/test_cloudfiles.py

Author: tomaz
Date: Sun Apr 21 18:06:39 2013
New Revision: 1470326

URL: http://svn.apache.org/r1470326
Log:
Backport commits from 0.12.x.

Modified:
    libcloud/trunk/   (props changed)
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/storage/drivers/cloudfiles.py
    libcloud/trunk/libcloud/test/compute/test_deployment.py
    libcloud/trunk/libcloud/test/storage/test_cloudfiles.py

Propchange: libcloud/trunk/
------------------------------------------------------------------------------
  Merged /libcloud/branches/0.12.x:r1468530-1470325

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1470326&r1=1470325&r2=1470326&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Sun Apr 21 18:06:39 2013
@@ -1,6 +1,6 @@
                                    -*- coding: utf-8 -*-
 
-Changes with Apache Libcloud in development:
+Changes with Apache Libcloud 0.12.4:
 
  *) Compute
 
@@ -26,6 +26,11 @@ Changes with Apache Libcloud in developm
       (LIBCLOUD-314)
       [Trevor Powell]
 
+ *) Storage
+
+    - Fix a regression with removed ex_force_service_region constructor kwarg in
+      the CloudFiles driver. (LIBCLOUD-260)
+
 Changes with Apache Libcloud 0.12.3:
 
   *) General

Modified: libcloud/trunk/libcloud/storage/drivers/cloudfiles.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py?rev=1470326&r1=1470325&r2=1470326&view=diff
==============================================================================
--- libcloud/trunk/libcloud/storage/drivers/cloudfiles.py (original)
+++ libcloud/trunk/libcloud/storage/drivers/cloudfiles.py Sun Apr 21 18:06:39 2013
@@ -113,6 +113,9 @@ class CloudFilesConnection(OpenStackBase
         self.accept_format = 'application/json'
         self.cdn_request = False
 
+        if self._ex_force_service_region:
+            self.service_region = self._ex_force_service_region
+
     def get_endpoint(self):
         # First, we parse out both files and cdn endpoints
         # for each auth version

Modified: libcloud/trunk/libcloud/test/compute/test_deployment.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/test_deployment.py?rev=1470326&r1=1470325&r2=1470326&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/compute/test_deployment.py (original)
+++ libcloud/trunk/libcloud/test/compute/test_deployment.py Sun Apr 21 18:06:39 2013
@@ -23,6 +23,7 @@ import unittest
 
 from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import u
+from libcloud.utils.py3 import PY32
 
 from libcloud.compute.deployment import MultiStepDeployment, Deployment
 from libcloud.compute.deployment import SSHKeyDeployment, ScriptDeployment
@@ -114,6 +115,10 @@ class DeploymentTests(unittest.TestCase)
                         client=MockClient(hostname='localhost')))
 
     def test_script_file_deployment(self):
+        # TODO: Fix 3.2 compatibility
+        if PY32:
+            return
+
         file_path = os.path.abspath(__file__)
         with open(file_path, 'rb') as fp:
             content = fp.read()

Modified: libcloud/trunk/libcloud/test/storage/test_cloudfiles.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/storage/test_cloudfiles.py?rev=1470326&r1=1470325&r2=1470326&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/storage/test_cloudfiles.py (original)
+++ libcloud/trunk/libcloud/test/storage/test_cloudfiles.py Sun Apr 21 18:06:39 2013
@@ -106,6 +106,23 @@ class CloudFilesTests(unittest.TestCase)
         self.assertEquals('/v1/MossoCloudFS',
             driver.connection.request_path)
 
+    def test_invalid_ex_force_service_region(self):
+        driver = CloudFilesStorageDriver('driver', 'dummy',
+                ex_force_service_region='invalid')
+
+        try:
+            driver.list_containers()
+        except:
+            e = sys.exc_info()[1]
+            self.assertEquals(e.value, 'Could not find specified endpoint')
+        else:
+            self.fail('Exception was not thrown')
+
+    def test_ex_force_service_region(self):
+        driver = CloudFilesStorageDriver('driver', 'dummy',
+                ex_force_service_region='ORD')
+        driver.list_containers()
+
     def test_force_auth_url_kwargs(self):
         kwargs = {
             'ex_force_auth_version': '2.0',