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 2019/12/13 16:27:17 UTC

[libcloud] branch trunk updated (d23eeb2 -> 179d5ae)

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.


    from d23eeb2  Add changelog entry.
     new 5c04f00  Only guess host from region map if not explicitly set
     new 50f4750  Add a test case for host argument having priority over region one.
     new 179d5ae  Add changelog entry.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.rst                      | 12 ++++++++++++
 libcloud/storage/drivers/s3.py   |  4 +++-
 libcloud/test/storage/test_s3.py |  8 ++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)


[libcloud] 02/03: Add a test case for host argument having priority over region one.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 50f475055733b6d617be1dfd64f45194d24c0cdc
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Dec 13 17:24:10 2019 +0100

    Add a test case for host argument having priority over region one.
---
 libcloud/test/storage/test_s3.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libcloud/test/storage/test_s3.py b/libcloud/test/storage/test_s3.py
index 4102483..39af09a 100644
--- a/libcloud/test/storage/test_s3.py
+++ b/libcloud/test/storage/test_s3.py
@@ -1071,6 +1071,14 @@ class S3Tests(unittest.TestCase):
         self.assertRaisesRegexp(ValueError, expected_msg, S3StorageDriver,
                                 *self.driver_args, region='foo')
 
+        # host argument still has precedence over reguin
+        driver3  = S3StorageDriver(*self.driver_args, region='ap-south-1', host='host1.bar.com')
+        self.assertEqual(driver3.region, 'ap-south-1')
+        self.assertEqual(driver3.connection.host, 'host1.bar.com')
+
+        driver4  = S3StorageDriver(*self.driver_args, host='host2.bar.com')
+        self.assertEqual(driver4.connection.host, 'host2.bar.com')
+
     def test_deprecated_driver_class_per_region(self):
         driver = S3USWestStorageDriver(*self.driver_args)
         self.assertEqual(driver.region, 'us-west-1')


[libcloud] 01/03: Only guess host from region map if not explicitly set

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 5c04f0049c8f615864ee3082abd2a3de33a6861c
Author: gluap <44...@users.noreply.github.com>
AuthorDate: Fri Dec 13 11:55:00 2019 +0100

    Only guess host from region map if not explicitly set
    
    Overwriting host parameter is inconsistent with function signature and a breaking change compared with previous behaviour
---
 libcloud/storage/drivers/s3.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libcloud/storage/drivers/s3.py b/libcloud/storage/drivers/s3.py
index 0b0e063..e18ab79 100644
--- a/libcloud/storage/drivers/s3.py
+++ b/libcloud/storage/drivers/s3.py
@@ -1050,7 +1050,9 @@ class S3StorageDriver(AWSDriver, BaseS3StorageDriver):
 
         self.name = 'Amazon S3 (%s)' % (region)
 
-        host = REGION_TO_HOST_MAP[region]
+        if host is None:
+            host = REGION_TO_HOST_MAP[region]
+
         super(S3StorageDriver, self).__init__(key=key, secret=secret,
                                               secure=secure, host=host,
                                               port=port,


[libcloud] 03/03: Add changelog entry.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 179d5aec5a47fc94f8f9ea3ecb81843b6cf10acf
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Dec 13 17:26:57 2019 +0100

    Add changelog entry.
---
 CHANGES.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/CHANGES.rst b/CHANGES.rst
index e4a24b1..dd2f1ca 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -12,6 +12,18 @@ Compute
   volume name to the API. (GITHUB-1380)
   [@mpempekos]
 
+Storage
+-------
+
+- [AWS S3] Make sure ``host`` driver constructor argument has priority
+  over ``region`` argument.
+
+  This means if you specify ``host`` and ``region`` argument, host won't be
+  inferred from the region, but ``host`` argument will be used for the actual
+  connection host value.
+  (GITHUB-1384, GITHUB-1383)
+  [@gluap]
+
 Changes in Apache Libcloud v2.7.0
 ---------------------------------