[python] add socket_options to configuration for the rest client (#7795)

* [python] add socket_options to configuration for the rest client

* (python-experimental) add socket_options to configuration for the rest client

This mirrors work done on the python generator

* (python-experimental) add test to cover socket_options is passed on from configuration

Co-authored-by: steve brazier <steve.brazier@trioptima.com>
This commit is contained in:
Steve B
2020-10-28 02:22:28 +01:00
committed by GitHub
parent 44f5f2bdd8
commit ea2cdd23c2
20 changed files with 120 additions and 15 deletions

View File

@@ -188,6 +188,9 @@ class Configuration(object):
# Enable client side validation
self.client_side_validation = True
# Options to pass down to the underlying urllib3 socket
self.socket_options = None
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)

View File

@@ -72,6 +72,9 @@ class RESTClientObject(object):
if configuration.retries is not None:
addition_pool_args['retries'] = configuration.retries
if configuration.socket_options is not None:
addition_pool_args['socket_options'] = configuration.socket_options
if maxsize is None:
if configuration.connection_pool_maxsize is not None:
maxsize = configuration.connection_pool_maxsize