libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [libcloud] Kami commented on a change in pull request #1552: Add support for Azure Government to Azure Blobs storage driver
Date Mon, 08 Feb 2021 10:42:08 GMT

Kami commented on a change in pull request #1552:
URL: https://github.com/apache/libcloud/pull/1552#discussion_r571943385



##########
File path: libcloud/storage/drivers/azure_blobs.py
##########
@@ -217,15 +221,34 @@ def __init__(self, key, secret=None, secure=True, host=None, port=None,
                                                       port=port, **kwargs)
 
     def _ex_connection_class_kwargs(self):
-        result = {}
-
-        # host argument has precedence
-        if not self._host_argument_set:
-            result['host'] = '%s.%s' % (self.key, AZURE_STORAGE_HOST_SUFFIX)
+        # if the user didn't provide a custom host value, assume we're
+        # targeting the default Azure Storage endpoints
+        if self._host is None:
+            return {'host': '%s.%s' % (self.key, AZURE_STORAGE_HOST_SUFFIX)}
+
+        # connecting to a special storage region like Azure Government or
+        # Azure China requires setting a custom storage endpoint but we
+        # still use the same scheme to identify a specific account as for
+        # the standard storage endpoint
+        try:
+            host_suffix = next(

Review comment:
       Is there a situation where we may want to allow end user to specify full host as-is
- aka so we don't add any prefix to it, but user already includes that in the ``host`` argument?
   
   I think this would give users more flexibility in some situations.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message