c-w commented on a change in pull request #1278: [LIBCLOUD-1037] Add Azurite
support for Azure Blob Storage driver
URL: https://github.com/apache/libcloud/pull/1278#discussion_r288575110
##########
File path: libcloud/storage/drivers/azure_blobs.py
##########
@@ -156,6 +156,27 @@ class AzureBlobsConnection(AzureConnection):
"""
Represents a single connection to Azure Blobs
"""
+ def __init__(self, *args, **kwargs):
+ self.account_prefix = kwargs.pop('account_prefix', None)
+ super(AzureBlobsConnection, self).__init__(*args, **kwargs)
+
+ def morph_action_hook(self, action):
+ action = super(AzureBlobsConnection, self).morph_action_hook(action)
+
+ # The main Azure Blob Storage service uses the hostname to distinguish
+ # between accounts, e.g. `theaccount.blob.core.windows.net`.
+ # However, some custom deployments of the service such as the official
+ # emulator (https://github.com/Azure/Azurite) instead use a URL prefix
+ # such as `/theaccount`. The use-case is drivers instantiated via
+ # `host=somewhere.tld` and `key='theaccount'`.
+ # If a user wants to specify a custom host without an account prefix,
+ # e.g. for use-cases where the custom host implements an auditing
+ # proxy or similar, they can instantiate the driver with
+ # `host=theaccount.somewhere.tld` and `key=''`.
+ if self.account_prefix:
Review comment:
Done.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services