Skip to content

Commit 75a6029

Browse files
committed
Fixing copy-paste errors and removing unsupported parameters
1 parent 2b1fe62 commit 75a6029

File tree

4 files changed

+35
-26
lines changed

4 files changed

+35
-26
lines changed

azure/storage/__init__.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@
4444
BLOB_SERVICE_HOST_BASE,
4545
TABLE_SERVICE_HOST_BASE,
4646
QUEUE_SERVICE_HOST_BASE,
47-
DEV_BLOB_HOST,
48-
DEV_TABLE_HOST,
49-
DEV_QUEUE_HOST,
50-
DEFAULT_HTTP_TIMEOUT,
5147
)
5248

5349
# x-ms-version for storage service.
@@ -1287,11 +1283,14 @@ def sign_request(self, request):
12871283

12881284

12891285
class StorageConnectionParameters(object):
1290-
'''Extract connection parameters from a connection string.
1286+
'''
1287+
Extract connection parameters from a connection string.
12911288
1292-
This is based on http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/ .
1289+
This is based on http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/ .
12931290
1294-
TODO "(Blob|Table|Queue|File)Endpoint" are not yet supported.
1291+
NOTE "(Blob|Table|Queue|File)Endpoint" are not supported.
1292+
dev_host and timeout cannot be specified with a connections tring.
1293+
"SharedAccessSignature" is not supported.
12951294
'''
12961295
def __init__(self, connection_string = ''):
12971296
connection_params = dict(s.split('=',1) for s in connection_string.split(';'))
@@ -1301,16 +1300,11 @@ def __init__(self, connection_string = ''):
13011300
self.protocol = connection_params.get('DefaultEndpointsProtocol', 'https')
13021301
endpoint_suffix = connection_params.get('EndpointSuffix', None)
13031302
self.host_base_blob = BLOB_SERVICE_HOST_BASE if endpoint_suffix is None \
1304-
else ".blob.{0}".format(endpoint_suffix)
1303+
else ".blob.{}".format(endpoint_suffix)
13051304
self.host_base_table = TABLE_SERVICE_HOST_BASE if endpoint_suffix is None \
1306-
else ".table.{0}".format(endpoint_suffix)
1305+
else ".table.{}".format(endpoint_suffix)
13071306
self.host_base_queue = QUEUE_SERVICE_HOST_BASE if endpoint_suffix is None \
1308-
else ".queue.{0}".format(endpoint_suffix)
1309-
self.dev_host_blob = DEV_BLOB_HOST
1310-
self.dev_host_table = DEV_TABLE_HOST
1311-
self.dev_host_queue = DEV_QUEUE_HOST
1312-
self.timeout = DEFAULT_HTTP_TIMEOUT
1313-
self.sas_token = connection_params.get('SharedAccessSignature', None)
1307+
else ".queue.{}".format(endpoint_suffix)
13141308

13151309

13161310
# make these available just from storage.

azure/storage/blobservice.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,21 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
101101
Optional. Timeout for the http request, in seconds.
102102
sas_token:
103103
Optional. Token to use to authenticate with shared access signature.
104+
connection_string:
105+
Optional. If specified, the first four parameters (account_name,
106+
account_key, protocol, host_base) may be overridden
107+
by values specified in the connection_string. The next three parameters
108+
(dev_host, timeout, sas_token) cannot be specified with a
109+
connection_string. See
110+
http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/
111+
for the connection string format.
104112
'''
105113
if connection_string is not None:
106114
connection_params = StorageConnectionParameters(connection_string)
107115
account_name = connection_params.account_name
108116
account_key = connection_params.account_key
109117
protocol = connection_params.protocol
110118
host_base = connection_params.host_base_blob
111-
dev_host = connection_params.dev_host_blob
112-
timeout = connection_params.timeout
113-
sas_token = connection_params.sas_token
114119

115120
self._BLOB_MAX_DATA_SIZE = 64 * 1024 * 1024
116121
self._BLOB_MAX_CHUNK_DATA_SIZE = 4 * 1024 * 1024

azure/storage/queueservice.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,21 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
8282
Optional. Timeout for the http request, in seconds.
8383
sas_token:
8484
Optional. Token to use to authenticate with shared access signature.
85+
connection_string:
86+
Optional. If specified, the first four parameters (account_name,
87+
account_key, protocol, host_base) may be overridden
88+
by values specified in the connection_string. The next three parameters
89+
(dev_host, timeout, sas_token) cannot be specified with a
90+
connection_string. See
91+
http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/
92+
for the connection string format.
8593
'''
8694
if connection_string is not None:
8795
connection_params = StorageConnectionParameters(connection_string)
8896
account_name = connection_params.account_name
8997
account_key = connection_params.account_key
9098
protocol = connection_params.protocol
91-
host_base = connection_params.host_base_blob
92-
dev_host = connection_params.dev_host_blob
93-
timeout = connection_params.timeout
94-
sas_token = connection_params.sas_token
99+
host_base = connection_params.host_base_queue
95100

96101
super(QueueService, self).__init__(
97102
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token)

azure/storage/tableservice.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,21 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
8080
Optional. Timeout for the http request, in seconds.
8181
sas_token:
8282
Optional. Token to use to authenticate with shared access signature.
83+
connection_string:
84+
Optional. If specified, the first four parameters (account_name,
85+
account_key, protocol, host_base) may be overridden
86+
by values specified in the connection_string. The next three parameters
87+
(dev_host, timeout, sas_token) cannot be specified with a
88+
connection_string. See
89+
http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/
90+
for the connection string format.
8391
'''
8492
if connection_string is not None:
8593
connection_params = StorageConnectionParameters(connection_string)
8694
account_name = connection_params.account_name
8795
account_key = connection_params.account_key
8896
protocol = connection_params.protocol
89-
host_base = connection_params.host_base_blob
90-
dev_host = connection_params.dev_host_blob
91-
timeout = connection_params.timeout
92-
sas_token = connection_params.sas_token
97+
host_base = connection_params.host_base_table
9398

9499
super(TableService, self).__init__(
95100
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token)

0 commit comments

Comments
 (0)