Skip to content

Commit

Permalink
[Blob][Fileshare] Ensured that download fails if blob/file modified m…
Browse files Browse the repository at this point in the history
…id download (Azure#19276)

* Ensured that download fails if blob/file modified mid download

* fixed linter

* ResourceModifiedError
  • Loading branch information
tasherif-msft authored and rakshith91 committed Jul 16, 2021
1 parent a6b6f7b commit f938c57
Show file tree
Hide file tree
Showing 12 changed files with 2,109 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,8 @@ def _initial_request(self):
# If the file is small, the download is complete at this point.
# If file size is large, download the rest of the file in chunks.
if response.properties.size != self.size:
# Lock on the etag. This can be overriden by the user by specifying '*'
if self._request_options.get("modified_access_conditions"):
if not self._request_options["modified_access_conditions"].if_match:
self._request_options["modified_access_conditions"].if_match = response.properties.etag
self._request_options["modified_access_conditions"].if_match = response.properties.etag
else:
self._download_complete = True
return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,8 @@ async def _initial_request(self):
# If the file is small, the download is complete at this point.
# If file size is large, download the rest of the file in chunks.
if response.properties.size != self.size:
# Lock on the etag. This can be overriden by the user by specifying '*'
if self._request_options.get('modified_access_conditions'):
if not self._request_options['modified_access_conditions'].if_match:
self._request_options['modified_access_conditions'].if_match = response.properties.etag
self._request_options['modified_access_conditions'].if_match = response.properties.etag
else:
self._download_complete = True
return response
Expand Down
Loading

0 comments on commit f938c57

Please sign in to comment.