From 5ee7aacca0f6db7d44683d34b5f775017540fe0a Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 28 Jun 2017 14:31:59 -0700 Subject: [PATCH] Bump docker Python SDK version -> 2.4.2 Signed-off-by: Joffrey F --- compose/config/types.py | 38 +++++++++++++++++++++----------------- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/compose/config/types.py b/compose/config/types.py index 4509bfe67..be26971c4 100644 --- a/compose/config/types.py +++ b/compose/config/types.py @@ -295,24 +295,28 @@ class ServicePort(namedtuple('_ServicePort', 'target published protocol mode ext if not isinstance(spec, dict): result = [] - for k, v in build_port_bindings([spec]).items(): - if '/' in k: - target, proto = k.split('/', 1) - else: - target, proto = (k, None) - for pub in v: - if pub is None: - result.append( - cls(target, None, proto, None, None) - ) - elif isinstance(pub, tuple): - result.append( - cls(target, pub[1], proto, None, pub[0]) - ) + try: + for k, v in build_port_bindings([spec]).items(): + if '/' in k: + target, proto = k.split('/', 1) else: - result.append( - cls(target, pub, proto, None, None) - ) + target, proto = (k, None) + for pub in v: + if pub is None: + result.append( + cls(target, None, proto, None, None) + ) + elif isinstance(pub, tuple): + result.append( + cls(target, pub[1], proto, None, pub[0]) + ) + else: + result.append( + cls(target, pub, proto, None, None) + ) + except ValueError as e: + raise ConfigurationError(str(e)) + return result return [cls( diff --git a/requirements.txt b/requirements.txt index c4545de1e..4d506b9f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ PyYAML==3.11 backports.ssl-match-hostname==3.5.0.1; python_version < '3' cached-property==1.2.0 colorama==0.3.7 -docker==2.3.0 +docker==2.4.2 dockerpty==0.4.1 docopt==0.6.1 enum34==1.0.4; python_version < '3.4' diff --git a/setup.py b/setup.py index 8dbb337cc..0d5bd6adc 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ install_requires = [ 'requests >= 2.6.1, != 2.11.0, < 2.12', 'texttable >= 0.8.1, < 0.9', 'websocket-client >= 0.32.0, < 1.0', - 'docker >= 2.3.0, < 3.0', + 'docker >= 2.4.2, < 3.0', 'dockerpty >= 0.4.1, < 0.5', 'six >= 1.3.0, < 2', 'jsonschema >= 2.5.1, < 3',