Fix extra warnings on masked volumes.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2015-11-13 10:49:17 -05:00
commit e1308a8329
2 changed files with 39 additions and 1 deletions

View file

@ -963,7 +963,10 @@ def warn_on_masked_volume(volumes_option, container_volumes, service):
for volume in container_volumes)
for volume in volumes_option:
if container_volumes.get(volume.internal) != volume.external:
if (
volume.internal in container_volumes and
container_volumes.get(volume.internal) != volume.external
):
log.warn((
"Service \"{service}\" is using volume \"{volume}\" from the "
"previous container. Host mapping \"{host_path}\" has no effect. "