From d5b82d67b84a9d54a231a79bba8d9692c8ed609a Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Fri, 13 May 2016 00:30:36 -0400 Subject: [PATCH] Fail gracefully when build path is not found. --- lib/ansible/modules/cloud/docker/docker_image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/cloud/docker/docker_image.py b/lib/ansible/modules/cloud/docker/docker_image.py index 2c69d1dc9ae..03bcd8a3e79 100644 --- a/lib/ansible/modules/cloud/docker/docker_image.py +++ b/lib/ansible/modules/cloud/docker/docker_image.py @@ -259,6 +259,8 @@ class ImageManager(DockerBaseClass): if not image or self.force: if self.path: # Build the image + if not os.path.isdir(self.path): + self.fail("Requested build path %s could not be found or you do not have access." % self.path) image_name = self.name if self.tag: image_name = "%s:%s" % (self.name, self.tag)