Skip to content

Commit a4c251d

Browse files
author
Ulysses Souza
authored
Merge pull request #2299 from ulyssessouza/3.7.2-release
Bump 3.7.2 release
2 parents cb8b462 + 8f2d9a5 commit a4c251d

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

docker/utils/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,7 @@ def kwargs_from_env(ssl_version=None, assert_hostname=None, environment=None):
352352
params = {}
353353

354354
if host:
355-
params['base_url'] = (
356-
host.replace('tcp://', 'https://') if enable_tls else host
357-
)
355+
params['base_url'] = host
358356

359357
if not enable_tls:
360358
return params

docker/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "3.7.1"
1+
version = "3.7.2"
22
version_info = tuple([int(d) for d in version.split("-")[0].split(".")])

docs/change-log.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Change log
22
==========
33

4+
3.7.2
5+
-----
6+
7+
[List of PRs / issues for this release](https://github.com/docker/docker-py/milestone/59?closed=1)
8+
9+
### Bugfixes
10+
11+
* Fix base_url to keep TCP protocol on utils.py by letting the responsability of changing the
12+
protocol to `parse_host` afterwards, letting `base_url` with the original value.
13+
* XFAIL test_attach_stream_and_cancel on TLS
14+
415
3.7.1
516
-----
617

scripts/versions.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,9 @@ def main():
6262
for url in [base_url.format(cat) for cat in categories]:
6363
res = requests.get(url)
6464
content = res.text
65-
versions = [
66-
Version.parse(
67-
v.strip('"').lstrip('docker-').rstrip('.tgz').rstrip('-x86_64')
68-
) for v in re.findall(
69-
r'"docker-[0-9]+\.[0-9]+\.[0-9]+-?.*tgz"', content
70-
)
71-
]
65+
versions = [Version.parse(v) for v in re.findall(
66+
r'"docker-([0-9]+\.[0-9]+\.[0-9]+)-?.*tgz"', content
67+
)]
7268
sorted_versions = sorted(
7369
versions, reverse=True, key=operator.attrgetter('order')
7470
)

tests/integration/api_container_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,6 @@ def test_kill_with_signal_integer(self):
10801080

10811081
class PortTest(BaseAPIIntegrationTest):
10821082
def test_port(self):
1083-
10841083
port_bindings = {
10851084
'1111': ('127.0.0.1', '4567'),
10861085
'2222': ('127.0.0.1', '4568')
@@ -1260,6 +1259,9 @@ def test_attach_no_stream(self):
12601259
@pytest.mark.timeout(5)
12611260
@pytest.mark.skipif(os.environ.get('DOCKER_HOST', '').startswith('ssh://'),
12621261
reason='No cancellable streams over SSH')
1262+
@pytest.mark.xfail(condition=os.environ.get('DOCKER_TLS_VERIFY') or
1263+
os.environ.get('DOCKER_CERT_PATH'),
1264+
reason='Flaky test on TLS')
12631265
def test_attach_stream_and_cancel(self):
12641266
container = self.client.create_container(
12651267
BUSYBOX, 'sh -c "echo hello && sleep 60"',

tests/unit/utils_test.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212

1313
from docker.api.client import APIClient
14+
from docker.constants import IS_WINDOWS_PLATFORM
1415
from docker.errors import DockerException
1516
from docker.utils import (
1617
convert_filters, convert_volume_binds, decode_json_header, kwargs_from_env,
@@ -83,15 +84,17 @@ def test_kwargs_from_env_tls(self):
8384
DOCKER_CERT_PATH=TEST_CERT_DIR,
8485
DOCKER_TLS_VERIFY='1')
8586
kwargs = kwargs_from_env(assert_hostname=False)
86-
assert 'https://192.168.59.103:2376' == kwargs['base_url']
87+
assert 'tcp://192.168.59.103:2376' == kwargs['base_url']
8788
assert 'ca.pem' in kwargs['tls'].ca_cert
8889
assert 'cert.pem' in kwargs['tls'].cert[0]
8990
assert 'key.pem' in kwargs['tls'].cert[1]
9091
assert kwargs['tls'].assert_hostname is False
9192
assert kwargs['tls'].verify
93+
94+
parsed_host = parse_host(kwargs['base_url'], IS_WINDOWS_PLATFORM, True)
9295
try:
9396
client = APIClient(**kwargs)
94-
assert kwargs['base_url'] == client.base_url
97+
assert parsed_host == client.base_url
9598
assert kwargs['tls'].ca_cert == client.verify
9699
assert kwargs['tls'].cert == client.cert
97100
except TypeError as e:
@@ -102,15 +105,16 @@ def test_kwargs_from_env_tls_verify_false(self):
102105
DOCKER_CERT_PATH=TEST_CERT_DIR,
103106
DOCKER_TLS_VERIFY='')
104107
kwargs = kwargs_from_env(assert_hostname=True)
105-
assert 'https://192.168.59.103:2376' == kwargs['base_url']
108+
assert 'tcp://192.168.59.103:2376' == kwargs['base_url']
106109
assert 'ca.pem' in kwargs['tls'].ca_cert
107110
assert 'cert.pem' in kwargs['tls'].cert[0]
108111
assert 'key.pem' in kwargs['tls'].cert[1]
109112
assert kwargs['tls'].assert_hostname is True
110113
assert kwargs['tls'].verify is False
114+
parsed_host = parse_host(kwargs['base_url'], IS_WINDOWS_PLATFORM, True)
111115
try:
112116
client = APIClient(**kwargs)
113-
assert kwargs['base_url'] == client.base_url
117+
assert parsed_host == client.base_url
114118
assert kwargs['tls'].cert == client.cert
115119
assert not kwargs['tls'].verify
116120
except TypeError as e:

0 commit comments

Comments
 (0)