From 85b96209535798756325c042fde3e6820ffd50c3 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 12 Feb 2016 16:25:43 +0100 Subject: [PATCH] Fix error when a container has no volumes --- gns3server/modules/docker/docker_vm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/docker/docker_vm.py b/gns3server/modules/docker/docker_vm.py index aa6a4e69..cb6a161d 100644 --- a/gns3server/modules/docker/docker_vm.py +++ b/gns3server/modules/docker/docker_vm.py @@ -133,7 +133,10 @@ class DockerVM(BaseVM): :returns: Return the path that we need to map to local folders """ binds = [] - for volume in image_infos.get("ContainerConfig", {}).get("Volumes", {}).keys(): + volumes = image_infos.get("ContainerConfig", {}).get("Volumes") + if volumes is None: + return binds + for volume in volumes.keys(): source = os.path.join(self.working_dir, os.path.relpath(volume, "/")) os.makedirs(source, exist_ok=True) binds.append("{}:{}".format(source, volume))