4747}
4848
4949class _ServiceParameters (object ):
50- def __init__ (self , service , account_name = None , account_key = None , sas_token = None ,
51- is_emulated = False , protocol = DEFAULT_PROTOCOL , endpoint_suffix = SERVICE_HOST_BASE ,
50+ def __init__ (self , service , account_name = None , account_key = None , sas_token = None ,
51+ is_emulated = False , protocol = DEFAULT_PROTOCOL , endpoint_suffix = SERVICE_HOST_BASE ,
5252 custom_domain = None ):
5353
5454 self .account_name = account_name
@@ -83,36 +83,37 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
8383 self .protocol = self .protocol if parsed_url .scheme is '' else parsed_url .scheme
8484 else :
8585 if not self .account_name :
86- raise ValueError (_ERROR_STORAGE_MISSING_INFO )
86+ raise ValueError (_ERROR_STORAGE_MISSING_INFO )
8787 self .primary_endpoint = '{}.{}.{}' .format (self .account_name , service , endpoint_suffix )
88-
88+
8989 # Setup the secondary endpoint
9090 if self .account_name :
9191 self .secondary_endpoint = '{}-secondary.{}.{}' .format (self .account_name , service , endpoint_suffix )
9292 else :
9393 self .secondary_endpoint = None
9494
9595 @staticmethod
96- def get_service_parameters (service , account_name = None , account_key = None , sas_token = None , is_emulated = None ,
97- protocol = None , endpoint_suffix = None , custom_domain = None , request_session = None ,
98- connection_string = None ):
96+ def get_service_parameters (service , account_name = None , account_key = None , sas_token = None , is_emulated = None ,
97+ protocol = None , endpoint_suffix = None , custom_domain = None , request_session = None ,
98+ connection_string = None , socket_timeout = None ):
9999 if connection_string :
100100 params = _ServiceParameters ._from_connection_string (connection_string , service )
101101 elif is_emulated :
102102 params = _ServiceParameters (service , is_emulated = True )
103103 elif account_name :
104104 params = _ServiceParameters (service ,
105- account_name = account_name ,
106- account_key = account_key ,
107- sas_token = sas_token ,
108- is_emulated = is_emulated ,
109- protocol = protocol ,
105+ account_name = account_name ,
106+ account_key = account_key ,
107+ sas_token = sas_token ,
108+ is_emulated = is_emulated ,
109+ protocol = protocol ,
110110 endpoint_suffix = endpoint_suffix ,
111111 custom_domain = custom_domain )
112112 else :
113113 raise ValueError (_ERROR_STORAGE_MISSING_INFO )
114114
115115 params .request_session = request_session
116+ params .socket_timeout = socket_timeout
116117 return params
117118
118119 @staticmethod
@@ -136,10 +137,10 @@ def _from_connection_string(connection_string, service):
136137 endpoint = config .get (_CONNECTION_ENDPONTS [service ])
137138
138139 return _ServiceParameters (service ,
139- account_name = account_name ,
140- account_key = account_key ,
141- sas_token = sas_token ,
142- is_emulated = is_emulated ,
143- protocol = protocol ,
140+ account_name = account_name ,
141+ account_key = account_key ,
142+ sas_token = sas_token ,
143+ is_emulated = is_emulated ,
144+ protocol = protocol ,
144145 endpoint_suffix = endpoint_suffix ,
145146 custom_domain = endpoint )
0 commit comments