Merge pull request #2258 from SamYaple/fix_docker_bug_2257
Don't assume ExposedPorts exists (bug #2257)
This commit is contained in:
commit
4c14e6267f
1 changed files with 2 additions and 2 deletions
|
@ -1062,11 +1062,11 @@ class DockerManager(object):
|
|||
continue
|
||||
|
||||
# EXPOSED PORTS
|
||||
expected_exposed_ports = set((image['ContainerConfig']['ExposedPorts'] or {}).keys())
|
||||
expected_exposed_ports = set((image['ContainerConfig'].get('ExposedPorts') or {}).keys())
|
||||
for p in (self.exposed_ports or []):
|
||||
expected_exposed_ports.add("/".join(p))
|
||||
|
||||
actually_exposed_ports = set((container["Config"]["ExposedPorts"] or {}).keys())
|
||||
actually_exposed_ports = set((container["Config"].get("ExposedPorts") or {}).keys())
|
||||
|
||||
if actually_exposed_ports != expected_exposed_ports:
|
||||
self.reload_reasons.append('exposed_ports ({0} => {1})'.format(actually_exposed_ports, expected_exposed_ports))
|
||||
|
|
Loading…
Reference in a new issue