Skip to content

Commit 055de16

Browse files
committed
Removed OAUTH_STORAGE_ACCOUNT from tests and fixed recordings
1 parent ba4355f commit 055de16

40 files changed

+1001
-2381
lines changed

azure-storage-blob/azure/storage/blob/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
BatchSetBlobTierSubRequest,
3232
BatchSubResponse,
3333
CustomerProvidedEncryptionKey,
34+
RehydratePriority,
3435
)
3536
from .pageblobservice import PageBlobService
3637
from ._constants import __version__

azure-storage-blob/azure/storage/blob/appendblobservice.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def __init__(self, account_name=None, account_key=None, sas_token=None, is_emula
124124
def create_blob(self, container_name, blob_name, content_settings=None,
125125
metadata=None, lease_id=None,
126126
if_modified_since=None, if_unmodified_since=None,
127-
if_match=None, if_none_match=None, cpk=None, timeout=None):
127+
if_match=None, if_none_match=None, timeout=None, cpk=None):
128128
'''
129129
Creates a blob or overrides an existing blob. Use if_none_match=* to
130130
prevent overriding an existing blob.
@@ -204,7 +204,7 @@ def append_block(self, container_name, blob_name, block,
204204
appendpos_condition=None,
205205
lease_id=None, if_modified_since=None,
206206
if_unmodified_since=None, if_match=None,
207-
if_none_match=None, cpk=None, timeout=None):
207+
if_none_match=None, timeout=None, cpk=None):
208208
'''
209209
Commits a new block of data to the end of an existing append blob.
210210
@@ -306,7 +306,7 @@ def append_block_from_url(self, container_name, blob_name, copy_source_url, sour
306306
source_if_none_match=None, maxsize_condition=None,
307307
appendpos_condition=None, lease_id=None, if_modified_since=None,
308308
if_unmodified_since=None, if_match=None,
309-
if_none_match=None, cpk=None, timeout=None):
309+
if_none_match=None, timeout=None, cpk=None):
310310
"""
311311
Creates a new block to be committed as part of a blob, where the contents are read from a source url.
312312

azure-storage-blob/azure/storage/blob/baseblobservice.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ def get_blob_service_properties(self, timeout=None):
15861586
def get_blob_properties(
15871587
self, container_name, blob_name, snapshot=None, lease_id=None,
15881588
if_modified_since=None, if_unmodified_since=None, if_match=None,
1589-
if_none_match=None, cpk=None, timeout=None):
1589+
if_none_match=None, timeout=None, cpk=None):
15901590
'''
15911591
Returns all user-defined metadata, standard HTTP properties, and
15921592
system properties for the blob. It does not return the content of the blob.
@@ -1656,7 +1656,7 @@ def get_blob_properties(
16561656
def set_blob_properties(
16571657
self, container_name, blob_name, content_settings=None, lease_id=None,
16581658
if_modified_since=None, if_unmodified_since=None, if_match=None,
1659-
if_none_match=None, cpk=None, timeout=None):
1659+
if_none_match=None, timeout=None, cpk=None):
16601660
'''
16611661
Sets system properties on the blob. If one property is set for the
16621662
content_settings, all properties will be overriden.
@@ -1890,8 +1890,7 @@ def get_blob_to_path(
18901890
snapshot=None, start_range=None, end_range=None,
18911891
validate_content=False, progress_callback=None,
18921892
max_connections=2, lease_id=None, if_modified_since=None,
1893-
if_unmodified_since=None, if_match=None, if_none_match=None, cpk=None,
1894-
timeout=None):
1893+
if_unmodified_since=None, if_match=None, if_none_match=None, timeout=None, cpk=None):
18951894
'''
18961895
Downloads a blob to a file path, with automatic chunking and progress
18971896
notifications. Returns an instance of :class:`~azure.storage.blob.models.Blob` with
@@ -2010,8 +2009,8 @@ def get_blob_to_path(
20102009
if_unmodified_since,
20112010
if_match,
20122011
if_none_match,
2013-
cpk,
2014-
timeout)
2012+
timeout=timeout,
2013+
cpk=cpk)
20152014

20162015
return blob
20172016

@@ -2020,7 +2019,7 @@ def get_blob_to_stream(
20202019
start_range=None, end_range=None, validate_content=False,
20212020
progress_callback=None, max_connections=2, lease_id=None,
20222021
if_modified_since=None, if_unmodified_since=None, if_match=None,
2023-
if_none_match=None, cpk=None, timeout=None):
2022+
if_none_match=None, timeout=None, cpk=None):
20242023

20252024
'''
20262025
Downloads a blob to a stream, with automatic chunking and progress
@@ -2257,7 +2256,7 @@ def get_blob_to_bytes(
22572256
start_range=None, end_range=None, validate_content=False,
22582257
progress_callback=None, max_connections=2, lease_id=None,
22592258
if_modified_since=None, if_unmodified_since=None, if_match=None,
2260-
if_none_match=None, cpk=None, timeout=None):
2259+
if_none_match=None, timeout=None, cpk=None):
22612260
'''
22622261
Downloads a blob as an array of bytes, with automatic chunking and
22632262
progress notifications. Returns an instance of :class:`~azure.storage.blob.models.Blob` with
@@ -2365,8 +2364,8 @@ def get_blob_to_bytes(
23652364
if_unmodified_since,
23662365
if_match,
23672366
if_none_match,
2368-
cpk,
2369-
timeout)
2367+
timeout=timeout,
2368+
cpk=cpk)
23702369

23712370
blob.content = stream.getvalue()
23722371
return blob
@@ -2376,7 +2375,7 @@ def get_blob_to_text(
23762375
start_range=None, end_range=None, validate_content=False,
23772376
progress_callback=None, max_connections=2, lease_id=None,
23782377
if_modified_since=None, if_unmodified_since=None, if_match=None,
2379-
if_none_match=None, cpk=None, timeout=None):
2378+
if_none_match=None, timeout=None, cpk=None):
23802379
'''
23812380
Downloads a blob as unicode text, with automatic chunking and progress
23822381
notifications. Returns an instance of :class:`~azure.storage.blob.models.Blob` with
@@ -2484,15 +2483,15 @@ def get_blob_to_text(
24842483
if_unmodified_since,
24852484
if_match,
24862485
if_none_match,
2487-
cpk,
2488-
timeout)
2486+
timeout=timeout,
2487+
cpk=cpk)
24892488
blob.content = blob.content.decode(encoding)
24902489
return blob
24912490

24922491
def get_blob_metadata(
24932492
self, container_name, blob_name, snapshot=None, lease_id=None,
24942493
if_modified_since=None, if_unmodified_since=None, if_match=None,
2495-
if_none_match=None, cpk=None, timeout=None):
2494+
if_none_match=None, timeout=None, cpk=None):
24962495
'''
24972496
Returns all user-defined metadata for the specified blob or snapshot.
24982497
@@ -2561,7 +2560,7 @@ def get_blob_metadata(
25612560
def set_blob_metadata(self, container_name, blob_name,
25622561
metadata=None, lease_id=None,
25632562
if_modified_since=None, if_unmodified_since=None,
2564-
if_match=None, if_none_match=None, cpk=None, timeout=None):
2563+
if_match=None, if_none_match=None, timeout=None, cpk=None):
25652564
'''
25662565
Sets user-defined metadata for the specified blob as one or more
25672566
name-value pairs.
@@ -3040,7 +3039,7 @@ def change_blob_lease(self, container_name, blob_name,
30403039
def snapshot_blob(self, container_name, blob_name,
30413040
metadata=None, if_modified_since=None,
30423041
if_unmodified_since=None, if_match=None,
3043-
if_none_match=None, lease_id=None, cpk=None, timeout=None):
3042+
if_none_match=None, lease_id=None, timeout=None, cpk=None):
30443043
'''
30453044
Creates a read-only snapshot of a blob.
30463045

azure-storage-blob/azure/storage/blob/blockblobservice.py

Lines changed: 46 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def __init__(self, account_name=None, account_key=None, sas_token=None, is_emula
150150
custom_domain, request_session, connection_string, socket_timeout, token_credential)
151151

152152
def put_block(self, container_name, blob_name, block, block_id,
153-
validate_content=False, lease_id=None, cpk=None, timeout=None):
153+
validate_content=False, lease_id=None, timeout=None, cpk=None):
154154
'''
155155
Creates a new block to be committed as part of a blob.
156156
@@ -198,8 +198,8 @@ def put_block(self, container_name, blob_name, block, block_id,
198198
def put_block_list(
199199
self, container_name, blob_name, block_list, content_settings=None,
200200
metadata=None, validate_content=False, lease_id=None, if_modified_since=None,
201-
if_unmodified_since=None, if_match=None, if_none_match=None, cpk=None,
202-
timeout=None, standard_blob_tier=None):
201+
if_unmodified_since=None, if_match=None, if_none_match=None,
202+
timeout=None, standard_blob_tier=None, cpk=None):
203203
'''
204204
Writes a blob by specifying the list of block IDs that make up the blob.
205205
In order to be written as part of a blob, a block must have been
@@ -336,7 +336,7 @@ def get_block_list(self, container_name, blob_name, snapshot=None,
336336

337337
def put_block_from_url(self, container_name, blob_name, copy_source_url, block_id,
338338
source_range_start=None, source_range_end=None,
339-
source_content_md5=None, lease_id=None, cpk=None, timeout=None):
339+
source_content_md5=None, lease_id=None, timeout=None, cpk=None):
340340
"""
341341
Creates a new block to be committed as part of a blob.
342342
@@ -401,11 +401,10 @@ def put_block_from_url(self, container_name, blob_name, copy_source_url, block_i
401401

402402
# ----Convenience APIs-----------------------------------------------------
403403

404-
def create_blob_from_path(
405-
self, container_name, blob_name, file_path, content_settings=None,
406-
metadata=None, validate_content=False, progress_callback=None,
407-
max_connections=2, lease_id=None, if_modified_since=None,
408-
if_unmodified_since=None, if_match=None, if_none_match=None, cpk=None, timeout=None, standard_blob_tier=None):
404+
def create_blob_from_path(self, container_name, blob_name, file_path, content_settings=None, metadata=None,
405+
validate_content=False, progress_callback=None, max_connections=2, lease_id=None,
406+
if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None,
407+
timeout=None, standard_blob_tier=None, cpk=None):
409408
'''
410409
Creates a new blob from a file path, or updates the content of an
411410
existing blob, with automatic chunking and progress notifications.
@@ -482,31 +481,20 @@ def create_blob_from_path(
482481

483482
count = path.getsize(file_path)
484483
with open(file_path, 'rb') as stream:
485-
return self.create_blob_from_stream(
486-
container_name=container_name,
487-
blob_name=blob_name,
488-
stream=stream,
489-
count=count,
490-
content_settings=content_settings,
491-
metadata=metadata,
492-
validate_content=validate_content,
493-
lease_id=lease_id,
494-
progress_callback=progress_callback,
495-
max_connections=max_connections,
496-
if_modified_since=if_modified_since,
497-
if_unmodified_since=if_unmodified_since,
498-
if_match=if_match,
499-
if_none_match=if_none_match,
500-
standard_blob_tier=standard_blob_tier,
501-
cpk=cpk,
502-
timeout=timeout)
503-
504-
def create_blob_from_stream(
505-
self, container_name, blob_name, stream, count=None,
506-
content_settings=None, metadata=None, validate_content=False,
507-
progress_callback=None, max_connections=2, lease_id=None,
508-
if_modified_since=None, if_unmodified_since=None, if_match=None,
509-
if_none_match=None, cpk=None, timeout=None, use_byte_buffer=False, standard_blob_tier=None):
484+
return self.create_blob_from_stream(container_name=container_name, blob_name=blob_name, stream=stream,
485+
count=count, content_settings=content_settings, metadata=metadata,
486+
validate_content=validate_content, progress_callback=progress_callback,
487+
max_connections=max_connections, lease_id=lease_id,
488+
if_modified_since=if_modified_since,
489+
if_unmodified_since=if_unmodified_since, if_match=if_match,
490+
if_none_match=if_none_match, timeout=timeout,
491+
standard_blob_tier=standard_blob_tier, cpk=cpk)
492+
493+
def create_blob_from_stream(self, container_name, blob_name, stream, count=None, content_settings=None,
494+
metadata=None, validate_content=False, progress_callback=None, max_connections=2,
495+
lease_id=None, if_modified_since=None, if_unmodified_since=None, if_match=None,
496+
if_none_match=None, timeout=None, use_byte_buffer=False, standard_blob_tier=None,
497+
cpk=None):
510498
'''
511499
Creates a new blob from a file/stream, or updates the content of
512500
an existing blob, with automatic chunking and progress
@@ -712,12 +700,10 @@ def create_blob_from_stream(
712700
cpk=cpk,
713701
)
714702

715-
def create_blob_from_bytes(
716-
self, container_name, blob_name, blob, index=0, count=None,
717-
content_settings=None, metadata=None, validate_content=False,
718-
progress_callback=None, max_connections=2, lease_id=None,
719-
if_modified_since=None, if_unmodified_since=None, if_match=None,
720-
if_none_match=None, cpk=None, timeout=None, standard_blob_tier=None):
703+
def create_blob_from_bytes(self, container_name, blob_name, blob, index=0, count=None, content_settings=None,
704+
metadata=None, validate_content=False, progress_callback=None, max_connections=2,
705+
lease_id=None, if_modified_since=None, if_unmodified_since=None, if_match=None,
706+
if_none_match=None, timeout=None, standard_blob_tier=None, cpk=None):
721707
'''
722708
Creates a new blob from an array of bytes, or updates the content
723709
of an existing blob, with automatic chunking and progress
@@ -807,33 +793,19 @@ def create_blob_from_bytes(
807793
stream = BytesIO(blob)
808794
stream.seek(index)
809795

810-
return self.create_blob_from_stream(
811-
container_name=container_name,
812-
blob_name=blob_name,
813-
stream=stream,
814-
count=count,
815-
content_settings=content_settings,
816-
metadata=metadata,
817-
validate_content=validate_content,
818-
progress_callback=progress_callback,
819-
max_connections=max_connections,
820-
lease_id=lease_id,
821-
if_modified_since=if_modified_since,
822-
if_unmodified_since=if_unmodified_since,
823-
if_match=if_match,
824-
if_none_match=if_none_match,
825-
timeout=timeout,
826-
use_byte_buffer=True,
827-
standard_blob_tier=standard_blob_tier,
828-
cpk=cpk,
829-
)
830-
831-
def create_blob_from_text(
832-
self, container_name, blob_name, text, encoding='utf-8',
833-
content_settings=None, metadata=None, validate_content=False,
834-
progress_callback=None, max_connections=2, lease_id=None,
835-
if_modified_since=None, if_unmodified_since=None, if_match=None,
836-
if_none_match=None, cpk=None, timeout=None, standard_blob_tier=None):
796+
return self.create_blob_from_stream(container_name=container_name, blob_name=blob_name, stream=stream,
797+
count=count, content_settings=content_settings, metadata=metadata,
798+
validate_content=validate_content, progress_callback=progress_callback,
799+
max_connections=max_connections, lease_id=lease_id,
800+
if_modified_since=if_modified_since,
801+
if_unmodified_since=if_unmodified_since, if_match=if_match,
802+
if_none_match=if_none_match, timeout=timeout, use_byte_buffer=True,
803+
standard_blob_tier=standard_blob_tier, cpk=cpk)
804+
805+
def create_blob_from_text(self, container_name, blob_name, text, encoding='utf-8', content_settings=None,
806+
metadata=None, validate_content=False, progress_callback=None, max_connections=2,
807+
lease_id=None, if_modified_since=None, if_unmodified_since=None, if_match=None,
808+
if_none_match=None, timeout=None, standard_blob_tier=None, cpk=None):
837809
'''
838810
Creates a new blob from str/unicode, or updates the content of an
839811
existing blob, with automatic chunking and progress notifications.
@@ -912,25 +884,13 @@ def create_blob_from_text(
912884
_validate_not_none('encoding', encoding)
913885
text = text.encode(encoding)
914886

915-
return self.create_blob_from_bytes(
916-
container_name=container_name,
917-
blob_name=blob_name,
918-
blob=text,
919-
index=0,
920-
count=len(text),
921-
content_settings=content_settings,
922-
metadata=metadata,
923-
validate_content=validate_content,
924-
lease_id=lease_id,
925-
progress_callback=progress_callback,
926-
max_connections=max_connections,
927-
if_modified_since=if_modified_since,
928-
if_unmodified_since=if_unmodified_since,
929-
if_match=if_match,
930-
if_none_match=if_none_match,
931-
standard_blob_tier=standard_blob_tier,
932-
cpk=cpk,
933-
timeout=timeout)
887+
return self.create_blob_from_bytes(container_name=container_name, blob_name=blob_name, blob=text, index=0,
888+
count=len(text), content_settings=content_settings, metadata=metadata,
889+
validate_content=validate_content, progress_callback=progress_callback,
890+
max_connections=max_connections, lease_id=lease_id,
891+
if_modified_since=if_modified_since, if_unmodified_since=if_unmodified_since,
892+
if_match=if_match, if_none_match=if_none_match, timeout=timeout,
893+
standard_blob_tier=standard_blob_tier, cpk=cpk)
934894

935895
def set_standard_blob_tier(
936896
self, container_name, blob_name, standard_blob_tier, timeout=None, rehydrate_priority=None):

azure-storage-blob/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
]),
7373
install_requires=[
7474
'azure-common>=1.1.5',
75-
'azure-storage-common~=2.0'
75+
'azure-storage-common~=2.1'
7676
],
7777
extras_require={
7878
":python_version<'3.0'": ['futures'],

azure-storage-file/azure/storage/file/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717
SharePermissions,
1818
FilePermissions,
1919
DeleteSnapshot,
20+
SMBProperties,
21+
NTFSAttributes,
2022
)
2123
from ._constants import __version__

0 commit comments

Comments
 (0)