Skip to content

Commit

Permalink
Allow existing blobs to be overwritten in azure (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
kleesc committed Aug 24, 2020
1 parent 8583206 commit 4865572
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/azurestorage.py
Expand Up @@ -141,7 +141,7 @@ def get_content(self, path):
def put_content(self, path, content):
blob_name = self._blob_name_from_path(path)
try:
self._blob(blob_name).upload_blob(content, blob_type=BlobType.BlockBlob)
self._blob(blob_name).upload_blob(content, blob_type=BlobType.BlockBlob, overwrite=True)
except AzureError:
logger.exception("Exception when trying to put path %s", path)
raise IOError("Exception when trying to put path")
Expand Down Expand Up @@ -174,7 +174,7 @@ def stream_write(self, path, fp, content_type=None, content_encoding=None):
)

try:
self._blob(blob_name).upload_blob(fp, content_settings=content_settings)
self._blob(blob_name).upload_blob(fp, content_settings=content_settings, overwrite=True)
except AzureError as ae:
logger.exception("Exception when trying to stream_write path %s", path)
raise IOError("Exception when trying to stream_write path", ae)
Expand Down

0 comments on commit 4865572

Please sign in to comment.