Skip to content

Commit 8c4fd81

Browse files
committed
Move ssladapter to transport module
Signed-off-by: Joffrey F <[email protected]>
1 parent 96022e8 commit 8c4fd81

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docker/api/client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
from .service import ServiceApiMixin
1818
from .swarm import SwarmApiMixin
1919
from .volume import VolumeApiMixin
20-
from .. import auth, ssladapter
20+
from .. import auth
2121
from ..constants import (DEFAULT_TIMEOUT_SECONDS, DEFAULT_USER_AGENT,
2222
IS_WINDOWS_PLATFORM, DEFAULT_DOCKER_API_VERSION,
2323
STREAM_HEADER_SIZE_BYTES, DEFAULT_NUM_POOLS,
2424
MINIMUM_DOCKER_API_VERSION)
2525
from ..errors import (DockerException, TLSParameterError,
2626
create_api_error_from_http_exception)
2727
from ..tls import TLSConfig
28-
from ..transport import UnixAdapter
28+
from ..transport import SSLAdapter, UnixAdapter
2929
from ..utils import utils, check_resource, update_headers
3030
from ..utils.socket import frames_iter
3131
try:
@@ -121,9 +121,7 @@ def __init__(self, base_url=None, version=None,
121121
if isinstance(tls, TLSConfig):
122122
tls.configure_client(self)
123123
elif tls:
124-
self._custom_adapter = ssladapter.SSLAdapter(
125-
pool_connections=num_pools
126-
)
124+
self._custom_adapter = SSLAdapter(pool_connections=num_pools)
127125
self.mount('https://', self._custom_adapter)
128126
self.base_url = base_url
129127

docker/tls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import os
22
import ssl
33

4-
from . import errors, ssladapter
4+
from . import errors
5+
from .transport import SSLAdapter
56

67

78
class TLSConfig(object):
@@ -84,7 +85,7 @@ def configure_client(self, client):
8485
if self.cert:
8586
client.cert = self.cert
8687

87-
client.mount('https://', ssladapter.SSLAdapter(
88+
client.mount('https://', SSLAdapter(
8889
ssl_version=self.ssl_version,
8990
assert_hostname=self.assert_hostname,
9091
assert_fingerprint=self.assert_fingerprint,

docker/transport/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# flake8: noqa
22
from .unixconn import UnixAdapter
3+
from .ssladapter import SSLAdapter
34
try:
45
from .npipeconn import NpipeAdapter
56
from .npipesocket import NpipeSocket
File renamed without changes.

tests/unit/ssladapter_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from docker import ssladapter
2+
from docker.transport import ssladapter
33

44
try:
55
from backports.ssl_match_hostname import (

0 commit comments

Comments
 (0)