diff options
author | Joffrey F <f.joffrey@gmail.com> | 2017-06-22 12:00:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-22 12:00:16 -0700 |
commit | b9e5863e4838641390473f7157a4f8e9e187cc15 (patch) | |
tree | 9f2981016a83efc61c2889fce85bed2b574028d2 | |
parent | a3b1059839ee5314834131f1af9b391fca99bf13 (diff) | |
parent | 0165a343d51c8051f1793f62202e2f053ab1b594 (diff) | |
download | docker-py-b9e5863e4838641390473f7157a4f8e9e187cc15.tar.gz |
Merge pull request #1640 from zero57/add_attrs_for_pickling
Add attributes for pickling
-rw-r--r-- | docker/api/client.py | 6 | ||||
-rw-r--r-- | docker/transport/npipeconn.py | 5 | ||||
-rw-r--r-- | docker/transport/ssladapter.py | 4 | ||||
-rw-r--r-- | docker/transport/unixconn.py | 5 |
4 files changed, 20 insertions, 0 deletions
diff --git a/docker/api/client.py b/docker/api/client.py index 6e567b1..65b5baa 100644 --- a/docker/api/client.py +++ b/docker/api/client.py @@ -83,6 +83,12 @@ class APIClient( configuration. user_agent (str): Set a custom user agent for requests to the server. """ + + __attrs__ = requests.Session.__attrs__ + ['_auth_configs', + '_version', + 'base_url', + 'timeout'] + def __init__(self, base_url=None, version=None, timeout=DEFAULT_TIMEOUT_SECONDS, tls=False, user_agent=DEFAULT_USER_AGENT, num_pools=DEFAULT_NUM_POOLS): diff --git a/docker/transport/npipeconn.py b/docker/transport/npipeconn.py index db059b4..ab9b904 100644 --- a/docker/transport/npipeconn.py +++ b/docker/transport/npipeconn.py @@ -69,6 +69,11 @@ class NpipeHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool): class NpipeAdapter(requests.adapters.HTTPAdapter): + + __attrs__ = requests.adapters.HTTPAdapter.__attrs__ + ['npipe_path', + 'pools', + 'timeout'] + def __init__(self, base_url, timeout=60, pool_connections=constants.DEFAULT_NUM_POOLS): self.npipe_path = base_url.replace('npipe://', '') diff --git a/docker/transport/ssladapter.py b/docker/transport/ssladapter.py index 31f45fc..8fafec3 100644 --- a/docker/transport/ssladapter.py +++ b/docker/transport/ssladapter.py @@ -25,6 +25,10 @@ if sys.version_info[0] < 3 or sys.version_info[1] < 5: class SSLAdapter(HTTPAdapter): '''An HTTPS Transport Adapter that uses an arbitrary SSL version.''' + __attrs__ = HTTPAdapter.__attrs__ + ['assert_fingerprint', + 'assert_hostname', + 'ssl_version'] + def __init__(self, ssl_version=None, assert_hostname=None, assert_fingerprint=None, **kwargs): self.ssl_version = ssl_version diff --git a/docker/transport/unixconn.py b/docker/transport/unixconn.py index 978c87a..3565cfb 100644 --- a/docker/transport/unixconn.py +++ b/docker/transport/unixconn.py @@ -50,6 +50,11 @@ class UnixHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool): class UnixAdapter(requests.adapters.HTTPAdapter): + + __attrs__ = requests.adapters.HTTPAdapter.__attrs__ + ['pools', + 'socket_path', + 'timeout'] + def __init__(self, socket_url, timeout=60, pool_connections=constants.DEFAULT_NUM_POOLS): socket_path = socket_url.replace('http+unix://', '') |