Skip to content

Commit f2e1bdd

Browse files
author
Hugues Valois
committed
Merge pull request Azure#385 from huguesv/0_11_1
0.11.1
2 parents 9120bec + 7befce9 commit f2e1bdd

15 files changed

+117
-40
lines changed

ChangeLog.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2015-06-16 Version 0.11.1
2+
3+
* Azure storage connection string support
4+
* Add a request_session parameter to storage and service bus classes
5+
* Fixes for bugs:
6+
#370 Fix table service authentication for non-english locale
7+
#380 Make protocol string case insensitive
8+
#376 Make pyopenssl dependency optional
9+
#360 Installing `azure` on Python 3 should not install futures
10+
11+
Thank you to rchamorro, drdarshan, hosungs, h_yamaki for their contributions.
12+
113
2015-05-13 Version 0.11.0
214

315
IMPORTANT CHANGE THAT AFFECTS STORAGE:

azure/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#-------------------------------------------------------------------------
1+
#-------------------------------------------------------------------------
22
# Copyright (c) Microsoft. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,7 +43,7 @@
4343
# constants
4444

4545
__author__ = 'Microsoft Corp. <ptvshelp@microsoft.com>'
46-
__version__ = '0.11.0'
46+
__version__ = '0.11.1'
4747

4848
# Live ServiceClient URLs
4949
BLOB_SERVICE_HOST_BASE = '.blob.core.windows.net'

azure/servicebus/servicebusservice.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#-------------------------------------------------------------------------
1+
#-------------------------------------------------------------------------
22
# Copyright (c) Microsoft. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -68,7 +68,8 @@ class ServiceBusService(object):
6868
def __init__(self, service_namespace=None, account_key=None, issuer=None,
6969
x_ms_version='2011-06-01', host_base=SERVICE_BUS_HOST_BASE,
7070
shared_access_key_name=None, shared_access_key_value=None,
71-
authentication=None, timeout=DEFAULT_HTTP_TIMEOUT):
71+
authentication=None, timeout=DEFAULT_HTTP_TIMEOUT,
72+
request_session=None):
7273
'''
7374
Initializes the service bus service for a namespace with the specified
7475
authentication settings (SAS or ACS).
@@ -100,6 +101,9 @@ def __init__(self, service_namespace=None, account_key=None, issuer=None,
100101
ACS and SAS parameters are ignored.
101102
timeout:
102103
Optional. Timeout for the http request, in seconds.
104+
request_session:
105+
Optional. Session object to use for http requests. If this is
106+
specified, it replaces the default use of httplib.
103107
'''
104108
self.requestid = None
105109
self.service_namespace = service_namespace
@@ -131,7 +135,11 @@ def __init__(self, service_namespace=None, account_key=None, issuer=None,
131135
raise WindowsAzureError(
132136
'You need to provide servicebus access key and Issuer OR shared access key and value')
133137

134-
self._httpclient = _HTTPClient(service_instance=self, timeout=timeout)
138+
self._httpclient = _HTTPClient(
139+
service_instance=self,
140+
timeout=timeout,
141+
request_session=request_session,
142+
)
135143
self._filter = self._httpclient.perform_request
136144

137145
# Backwards compatibility:

azure/storage/blobservice.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#-------------------------------------------------------------------------
1+
#-------------------------------------------------------------------------
22
# Copyright (c) Microsoft. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,7 +84,8 @@ class BlobService(_StorageClient):
8484

8585
def __init__(self, account_name=None, account_key=None, protocol='https',
8686
host_base=BLOB_SERVICE_HOST_BASE, dev_host=DEV_BLOB_HOST,
87-
timeout=DEFAULT_HTTP_TIMEOUT, sas_token=None, connection_string=None):
87+
timeout=DEFAULT_HTTP_TIMEOUT, sas_token=None, connection_string=None,
88+
request_session=None):
8889
'''
8990
account_name:
9091
your storage account name, required for all operations.
@@ -109,6 +110,9 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
109110
connection_string. See
110111
http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/
111112
for the connection string format.
113+
request_session:
114+
Optional. Session object to use for http requests. If this is
115+
specified, it replaces the default use of httplib.
112116
'''
113117
if connection_string is not None:
114118
connection_params = StorageConnectionParameters(connection_string)
@@ -120,7 +124,7 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
120124
self._BLOB_MAX_DATA_SIZE = 64 * 1024 * 1024
121125
self._BLOB_MAX_CHUNK_DATA_SIZE = 4 * 1024 * 1024
122126
super(BlobService, self).__init__(
123-
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token)
127+
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token, request_session)
124128

125129
if self.account_key:
126130
self.authentication = StorageSharedKeyAuthentication(

azure/storage/queueservice.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#-------------------------------------------------------------------------
1+
#-------------------------------------------------------------------------
22
# Copyright (c) Microsoft. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -65,7 +65,8 @@ class QueueService(_StorageClient):
6565

6666
def __init__(self, account_name=None, account_key=None, protocol='https',
6767
host_base=QUEUE_SERVICE_HOST_BASE, dev_host=DEV_QUEUE_HOST,
68-
timeout=DEFAULT_HTTP_TIMEOUT, sas_token=None, connection_string=None):
68+
timeout=DEFAULT_HTTP_TIMEOUT, sas_token=None, connection_string=None,
69+
request_session=None):
6970
'''
7071
account_name:
7172
your storage account name, required for all operations.
@@ -90,6 +91,9 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
9091
connection_string. See
9192
http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/
9293
for the connection string format.
94+
request_session:
95+
Optional. Session object to use for http requests. If this is
96+
specified, it replaces the default use of httplib.
9397
'''
9498
if connection_string is not None:
9599
connection_params = StorageConnectionParameters(connection_string)
@@ -99,7 +103,7 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
99103
host_base = connection_params.host_base_queue
100104

101105
super(QueueService, self).__init__(
102-
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token)
106+
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token, request_session)
103107

104108
if self.account_key:
105109
self.authentication = StorageSharedKeyAuthentication(

azure/storage/storageclient.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#-------------------------------------------------------------------------
1+
#-------------------------------------------------------------------------
22
# Copyright (c) Microsoft. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,7 +43,7 @@ class _StorageClient(object):
4343

4444
def __init__(self, account_name=None, account_key=None, protocol='https',
4545
host_base='', dev_host='', timeout=DEFAULT_HTTP_TIMEOUT,
46-
sas_token=None):
46+
sas_token=None, request_session=None):
4747
'''
4848
account_name:
4949
your storage account name, required for all operations.
@@ -60,6 +60,9 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
6060
Optional. Timeout for the http request, in seconds.
6161
sas_token:
6262
Optional. Token to use to authenticate with shared access signature.
63+
request_session:
64+
Optional. Session object to use for http requests. If this is
65+
specified, it replaces the default use of httplib.
6366
'''
6467
self.account_name = account_name
6568
self.account_key = account_key
@@ -99,7 +102,9 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
99102
self._httpclient = _HTTPClient(
100103
service_instance=self,
101104
protocol=self.protocol,
102-
timeout=timeout)
105+
timeout=timeout,
106+
request_session=request_session,
107+
)
103108
self._batchclient = None
104109
self._filter = self._perform_request_worker
105110

azure/storage/tableservice.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#-------------------------------------------------------------------------
1+
#-------------------------------------------------------------------------
22
# Copyright (c) Microsoft. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -63,7 +63,8 @@ class TableService(_StorageClient):
6363

6464
def __init__(self, account_name=None, account_key=None, protocol='https',
6565
host_base=TABLE_SERVICE_HOST_BASE, dev_host=DEV_TABLE_HOST,
66-
timeout=DEFAULT_HTTP_TIMEOUT, sas_token=None, connection_string=None):
66+
timeout=DEFAULT_HTTP_TIMEOUT, sas_token=None, connection_string=None,
67+
request_session=None):
6768
'''
6869
account_name:
6970
your storage account name, required for all operations.
@@ -88,6 +89,9 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
8889
connection_string. See
8990
http://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/
9091
for the connection string format.
92+
request_session:
93+
Optional. Session object to use for http requests. If this is
94+
specified, it replaces the default use of httplib.
9195
'''
9296
if connection_string is not None:
9397
connection_params = StorageConnectionParameters(connection_string)
@@ -97,7 +101,7 @@ def __init__(self, account_name=None, account_key=None, protocol='https',
97101
host_base = connection_params.host_base_table
98102

99103
super(TableService, self).__init__(
100-
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token)
104+
account_name, account_key, protocol, host_base, dev_host, timeout, sas_token, request_session)
101105

102106
if self.account_key:
103107
self.authentication = StorageTableSharedKeyAuthentication(

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
# built documents.
5454
#
5555
# The short X.Y version.
56-
version = '0.11.0'
56+
version = '0.11.1'
5757
# The full version, including alpha/beta/rc tags.
58-
release = '0.11.0'
58+
release = '0.11.1'
5959

6060
# The language for content autogenerated by Sphinx. Refer to documentation
6161
# for a list of supported languages.

setup.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python
22

33
#-------------------------------------------------------------------------
44
# Copyright (c) Microsoft. All rights reserved.
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#--------------------------------------------------------------------------
17-
17+
import sys
1818
from distutils.core import setup
1919

2020
# To build:
@@ -29,8 +29,12 @@
2929
# To upload:
3030
# python setup.py sdist upload
3131

32+
reqs = ['python-dateutil']
33+
if sys.version_info < (3,0):
34+
reqs.append('futures')
35+
3236
setup(name='azure',
33-
version='0.11.0',
37+
version='0.11.1',
3438
description='Microsoft Azure client APIs',
3539
long_description=open('README.rst', 'r').read(),
3640
license='Apache License 2.0',
@@ -51,8 +55,7 @@
5155
'azure.servicebus',
5256
'azure.storage',
5357
'azure.servicemanagement'],
54-
install_requires=['python-dateutil',
55-
'futures'],
58+
install_requires=reqs,
5659
extras_require = {
5760
'get_certificate_from_publish_settings' : ['pyopenssl']
5861
}

tests/test_blobservice.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
from util import (
6565
AzureTestCase,
6666
credentials,
67+
create_storage_service,
6768
getUniqueName,
6869
set_service_options,
6970
)
@@ -75,16 +76,20 @@
7576
class BlobServiceTest(AzureTestCase):
7677

7778
def setUp(self):
78-
self.bs = BlobService(credentials.getStorageServicesName(),
79-
credentials.getStorageServicesKey())
80-
set_service_options(self.bs)
79+
self.bs = create_storage_service(
80+
BlobService,
81+
credentials.getStorageServicesName(),
82+
credentials.getStorageServicesKey(),
83+
)
8184

8285
remote_storage_service_name = credentials.getRemoteStorageServicesName()
8386
remote_storage_service_key = credentials.getRemoteStorageServicesKey()
8487
if remote_storage_service_key and remote_storage_service_name:
85-
self.bs2 = BlobService(credentials.getRemoteStorageServicesName(),
86-
credentials.getRemoteStorageServicesKey())
87-
set_service_options(self.bs2)
88+
self.bs2 = create_storage_service(
89+
BlobService,
90+
remote_storage_service_name,
91+
remote_storage_service_key,
92+
)
8893
else:
8994
print("Remote Storage Account not configured. Add " \
9095
"'remotestorageserviceskey' and 'remotestorageservicesname'" \

0 commit comments

Comments
 (0)