Skip to content

Commit

Permalink
Merge pull request #2299 from ulyssessouza/3.7.2-release
Browse files Browse the repository at this point in the history
Bump 3.7.2 release
  • Loading branch information
ulyssessouza authored Mar 28, 2019
2 parents cb8b462 + 8f2d9a5 commit a4c251d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 16 deletions.
4 changes: 1 addition & 3 deletions docker/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,7 @@ def kwargs_from_env(ssl_version=None, assert_hostname=None, environment=None):
params = {}

if host:
params['base_url'] = (
host.replace('tcp://', 'https://') if enable_tls else host
)
params['base_url'] = host

if not enable_tls:
return params
Expand Down
2 changes: 1 addition & 1 deletion docker/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "3.7.1"
version = "3.7.2"
version_info = tuple([int(d) for d in version.split("-")[0].split(".")])
11 changes: 11 additions & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
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
-----

Expand Down
10 changes: 3 additions & 7 deletions scripts/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,9 @@ def main():
for url in [base_url.format(cat) for cat in categories]:
res = requests.get(url)
content = res.text
versions = [
Version.parse(
v.strip('"').lstrip('docker-').rstrip('.tgz').rstrip('-x86_64')
) for v in re.findall(
r'"docker-[0-9]+\.[0-9]+\.[0-9]+-?.*tgz"', content
)
]
versions = [Version.parse(v) for v in re.findall(
r'"docker-([0-9]+\.[0-9]+\.[0-9]+)-?.*tgz"', content
)]
sorted_versions = sorted(
versions, reverse=True, key=operator.attrgetter('order')
)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/api_container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,6 @@ def test_kill_with_signal_integer(self):

class PortTest(BaseAPIIntegrationTest):
def test_port(self):

port_bindings = {
'1111': ('127.0.0.1', '4567'),
'2222': ('127.0.0.1', '4568')
Expand Down Expand Up @@ -1260,6 +1259,9 @@ def test_attach_no_stream(self):
@pytest.mark.timeout(5)
@pytest.mark.skipif(os.environ.get('DOCKER_HOST', '').startswith('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):
container = self.client.create_container(
BUSYBOX, 'sh -c "echo hello && sleep 60"',
Expand Down
12 changes: 8 additions & 4 deletions tests/unit/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


from docker.api.client import APIClient
from docker.constants import IS_WINDOWS_PLATFORM
from docker.errors import DockerException
from docker.utils import (
convert_filters, convert_volume_binds, decode_json_header, kwargs_from_env,
Expand Down Expand Up @@ -83,15 +84,17 @@ def test_kwargs_from_env_tls(self):
DOCKER_CERT_PATH=TEST_CERT_DIR,
DOCKER_TLS_VERIFY='1')
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 'cert.pem' in kwargs['tls'].cert[0]
assert 'key.pem' in kwargs['tls'].cert[1]
assert kwargs['tls'].assert_hostname is False
assert kwargs['tls'].verify

parsed_host = parse_host(kwargs['base_url'], IS_WINDOWS_PLATFORM, True)
try:
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'].cert == client.cert
except TypeError as e:
Expand All @@ -102,15 +105,16 @@ def test_kwargs_from_env_tls_verify_false(self):
DOCKER_CERT_PATH=TEST_CERT_DIR,
DOCKER_TLS_VERIFY='')
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 'cert.pem' in kwargs['tls'].cert[0]
assert 'key.pem' in kwargs['tls'].cert[1]
assert kwargs['tls'].assert_hostname is True
assert kwargs['tls'].verify is False
parsed_host = parse_host(kwargs['base_url'], IS_WINDOWS_PLATFORM, True)
try:
client = APIClient(**kwargs)
assert kwargs['base_url'] == client.base_url
assert parsed_host == client.base_url
assert kwargs['tls'].cert == client.cert
assert not kwargs['tls'].verify
except TypeError as e:
Expand Down

0 comments on commit a4c251d

Please sign in to comment.