Browse Source

Bump docker Python SDK version -> 2.4.2

Signed-off-by: Joffrey F <[email protected]>
Joffrey F 8 years ago
parent
commit
300b879d44
3 changed files with 23 additions and 19 deletions
  1. 21 17
      compose/config/types.py
  2. 1 1
      requirements.txt
  3. 1 1
      setup.py

+ 21 - 17
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(

+ 1 - 1
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'

+ 1 - 1
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',