Unverified Kaydet (Commit) a4c251d2 authored tarafından Ulysses Souza's avatar Ulysses Souza Kaydeden (comit) GitHub

Merge pull request #2299 from ulyssessouza/3.7.2-release

Bump 3.7.2 release
No related merge requests found
...@@ -352,9 +352,7 @@ def kwargs_from_env(ssl_version=None, assert_hostname=None, environment=None): ...@@ -352,9 +352,7 @@ def kwargs_from_env(ssl_version=None, assert_hostname=None, environment=None):
params = {} params = {}
if host: if host:
params['base_url'] = ( params['base_url'] = host
host.replace('tcp://', 'https://') if enable_tls else host
)
if not enable_tls: if not enable_tls:
return params return params
......
version = "3.7.1" version = "3.7.2"
version_info = tuple([int(d) for d in version.split("-")[0].split(".")]) version_info = tuple([int(d) for d in version.split("-")[0].split(".")])
Change log Change log
========== ==========
3.7.2
-----
[List of PRs / issues for this release](https://github.com/docker/docker-py/milestone/59?closed=1)
### Bugfixes
* Fix base_url to keep TCP protocol on utils.py by letting the responsability of changing the
protocol to `parse_host` afterwards, letting `base_url` with the original value.
* XFAIL test_attach_stream_and_cancel on TLS
3.7.1 3.7.1
----- -----
......
...@@ -62,13 +62,9 @@ def main(): ...@@ -62,13 +62,9 @@ def main():
for url in [base_url.format(cat) for cat in categories]: for url in [base_url.format(cat) for cat in categories]:
res = requests.get(url) res = requests.get(url)
content = res.text content = res.text
versions = [ versions = [Version.parse(v) for v in re.findall(
Version.parse( r'"docker-([0-9]+\.[0-9]+\.[0-9]+)-?.*tgz"', content
v.strip('"').lstrip('docker-').rstrip('.tgz').rstrip('-x86_64') )]
) for v in re.findall(
r'"docker-[0-9]+\.[0-9]+\.[0-9]+-?.*tgz"', content
)
]
sorted_versions = sorted( sorted_versions = sorted(
versions, reverse=True, key=operator.attrgetter('order') versions, reverse=True, key=operator.attrgetter('order')
) )
......
...@@ -1080,7 +1080,6 @@ class KillTest(BaseAPIIntegrationTest): ...@@ -1080,7 +1080,6 @@ class KillTest(BaseAPIIntegrationTest):
class PortTest(BaseAPIIntegrationTest): class PortTest(BaseAPIIntegrationTest):
def test_port(self): def test_port(self):
port_bindings = { port_bindings = {
'1111': ('127.0.0.1', '4567'), '1111': ('127.0.0.1', '4567'),
'2222': ('127.0.0.1', '4568') '2222': ('127.0.0.1', '4568')
...@@ -1260,6 +1259,9 @@ class AttachContainerTest(BaseAPIIntegrationTest): ...@@ -1260,6 +1259,9 @@ class AttachContainerTest(BaseAPIIntegrationTest):
@pytest.mark.timeout(5) @pytest.mark.timeout(5)
@pytest.mark.skipif(os.environ.get('DOCKER_HOST', '').startswith('ssh://'), @pytest.mark.skipif(os.environ.get('DOCKER_HOST', '').startswith('ssh://'),
reason='No cancellable streams over SSH') reason='No cancellable streams over SSH')
@pytest.mark.xfail(condition=os.environ.get('DOCKER_TLS_VERIFY') or
os.environ.get('DOCKER_CERT_PATH'),
reason='Flaky test on TLS')
def test_attach_stream_and_cancel(self): def test_attach_stream_and_cancel(self):
container = self.client.create_container( container = self.client.create_container(
BUSYBOX, 'sh -c "echo hello && sleep 60"', BUSYBOX, 'sh -c "echo hello && sleep 60"',
......
...@@ -11,6 +11,7 @@ import unittest ...@@ -11,6 +11,7 @@ import unittest
from docker.api.client import APIClient from docker.api.client import APIClient
from docker.constants import IS_WINDOWS_PLATFORM
from docker.errors import DockerException from docker.errors import DockerException
from docker.utils import ( from docker.utils import (
convert_filters, convert_volume_binds, decode_json_header, kwargs_from_env, convert_filters, convert_volume_binds, decode_json_header, kwargs_from_env,
...@@ -83,15 +84,17 @@ class KwargsFromEnvTest(unittest.TestCase): ...@@ -83,15 +84,17 @@ class KwargsFromEnvTest(unittest.TestCase):
DOCKER_CERT_PATH=TEST_CERT_DIR, DOCKER_CERT_PATH=TEST_CERT_DIR,
DOCKER_TLS_VERIFY='1') DOCKER_TLS_VERIFY='1')
kwargs = kwargs_from_env(assert_hostname=False) kwargs = kwargs_from_env(assert_hostname=False)
assert 'https://192.168.59.103:2376' == kwargs['base_url'] assert 'tcp://192.168.59.103:2376' == kwargs['base_url']
assert 'ca.pem' in kwargs['tls'].ca_cert assert 'ca.pem' in kwargs['tls'].ca_cert
assert 'cert.pem' in kwargs['tls'].cert[0] assert 'cert.pem' in kwargs['tls'].cert[0]
assert 'key.pem' in kwargs['tls'].cert[1] assert 'key.pem' in kwargs['tls'].cert[1]
assert kwargs['tls'].assert_hostname is False assert kwargs['tls'].assert_hostname is False
assert kwargs['tls'].verify assert kwargs['tls'].verify
parsed_host = parse_host(kwargs['base_url'], IS_WINDOWS_PLATFORM, True)
try: try:
client = APIClient(**kwargs) client = APIClient(**kwargs)
assert kwargs['base_url'] == client.base_url assert parsed_host == client.base_url
assert kwargs['tls'].ca_cert == client.verify assert kwargs['tls'].ca_cert == client.verify
assert kwargs['tls'].cert == client.cert assert kwargs['tls'].cert == client.cert
except TypeError as e: except TypeError as e:
...@@ -102,15 +105,16 @@ class KwargsFromEnvTest(unittest.TestCase): ...@@ -102,15 +105,16 @@ class KwargsFromEnvTest(unittest.TestCase):
DOCKER_CERT_PATH=TEST_CERT_DIR, DOCKER_CERT_PATH=TEST_CERT_DIR,
DOCKER_TLS_VERIFY='') DOCKER_TLS_VERIFY='')
kwargs = kwargs_from_env(assert_hostname=True) kwargs = kwargs_from_env(assert_hostname=True)
assert 'https://192.168.59.103:2376' == kwargs['base_url'] assert 'tcp://192.168.59.103:2376' == kwargs['base_url']
assert 'ca.pem' in kwargs['tls'].ca_cert assert 'ca.pem' in kwargs['tls'].ca_cert
assert 'cert.pem' in kwargs['tls'].cert[0] assert 'cert.pem' in kwargs['tls'].cert[0]
assert 'key.pem' in kwargs['tls'].cert[1] assert 'key.pem' in kwargs['tls'].cert[1]
assert kwargs['tls'].assert_hostname is True assert kwargs['tls'].assert_hostname is True
assert kwargs['tls'].verify is False assert kwargs['tls'].verify is False
parsed_host = parse_host(kwargs['base_url'], IS_WINDOWS_PLATFORM, True)
try: try:
client = APIClient(**kwargs) client = APIClient(**kwargs)
assert kwargs['base_url'] == client.base_url assert parsed_host == client.base_url
assert kwargs['tls'].cert == client.cert assert kwargs['tls'].cert == client.cert
assert not kwargs['tls'].verify assert not kwargs['tls'].verify
except TypeError as e: except TypeError as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment