diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 09bbe2f736b9..1bc35694835e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -23,7 +23,7 @@ /sdk/eventhub/ @annatisch @yunhaoling @YijunXieMS # PRLabel: %Storage -/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @kasobol-msft +/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @tasherif-msft @kasobol-msft /sdk/applicationinsights/ @alexeldeib diff --git a/.gitignore b/.gitignore index d357979f797d..41a2c9cf82f7 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,7 @@ src/build # [begoldsm] ignore virtual env if it exists. adlEnv/ - +venv/ code_reports # Azure Storage test credentials diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py index 092aadc7102c..7d384233c221 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py @@ -129,7 +129,7 @@ def acquire(self, lease_duration=-1, **kwargs): process_storage_error(error) self.id = response.get('lease_id') # type: str self.last_modified = response.get('last_modified') # type: datetime - self.etag = kwargs.get('etag') # type: str + self.etag = response.get('etag') # type: str @distributed_trace def renew(self, **kwargs): diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py index 6fb5f18e1e7b..5f68a9b7b874 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py @@ -115,7 +115,7 @@ async def acquire(self, lease_duration=-1, **kwargs): process_storage_error(error) self.id = response.get('lease_id') # type: str self.last_modified = response.get('last_modified') # type: datetime - self.etag = kwargs.get('etag') # type: str + self.etag = response.get('etag') # type: str @distributed_trace_async async def renew(self, **kwargs): diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py index 39d0cda15fde..876c8bb55849 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py @@ -1450,6 +1450,8 @@ def test_lease_blob_with_if_match(self, resource_group, location, storage_accoun # Assert self.assertIsInstance(lease, BlobLeaseClient) self.assertIsNotNone(lease.id) + self.assertIsNotNone(lease.etag) + self.assertEqual(lease.etag, etag) @GlobalStorageAccountPreparer() def test_lease_blob_with_if_match_fail(self, resource_group, location, storage_account, storage_account_key): diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py index 0b36e10a3a89..c7cb1af7b692 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py @@ -1542,6 +1542,8 @@ async def test_lease_blob_with_if_match(self, resource_group, location, storage_ # Assert self.assertIsInstance(lease, BlobLeaseClient) self.assertIsNotNone(lease.id) + self.assertIsNotNone(lease.etag) + self.assertEqual(lease.etag, etag) @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test