libcloud-notifications mailing list archives

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

Kami commented on a change in pull request #1552:

File path: libcloud/storage/drivers/
@@ -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:
       Yeah, I didn't really mean it as an alternative, but in addition to your proposed changes
(so the interface for the common case would still be the same, but in case there is a need
to use a fully custom host, there is an easy way to do it).
   I also don't think that's a blocker for this PR so if you think it's a good idea, feel
free to open a new PR with that change in the future.

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:

View raw message