From aa13a43c69d93bd3135ba5b721135d6284cd6c43 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 20 Apr 2014 08:13:59 -0700 Subject: [PATCH] providers/docker: its okay if no image file on destroy --- plugins/providers/docker/action/destroy_build_image.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/providers/docker/action/destroy_build_image.rb b/plugins/providers/docker/action/destroy_build_image.rb index bae5d7923..a5e1b4ad0 100644 --- a/plugins/providers/docker/action/destroy_build_image.rb +++ b/plugins/providers/docker/action/destroy_build_image.rb @@ -29,8 +29,12 @@ module VagrantPlugins machine.provider.driver.rmi(image) end - if image_file - image_file.delete + if image_file && image_file.file? + begin + image_file.delete + rescue Errno::ENOENT + # Its okay + end end @app.call(env)