lib/boxgrinder-ubuntu-plugin.rb in boxgrinder-ubuntu-plugin-0.1.1 vs lib/boxgrinder-ubuntu-plugin.rb in boxgrinder-ubuntu-plugin-0.1.2

- old
+ new

@@ -71,19 +71,25 @@ ddest = "#{@dir.base}/tmp/#{@appliance_config.name}-sda.qcow2" @log.debug "Moving qcow2 disk image from #{dsource} to #{ddest}" FileUtils.mv dsource, ddest @log.debug "Ubuntu appliance ready" rescue => e + @log.error "Could not create the appliance!" + @log.error $! + @log.error $@ + abort ensure # # Cleanup # # Set env var BOXGRINDER_DEBUG_NOCLEAN if you down't want to clean # tmp/out dirs (useful for debugging) # if not ENV["BOXGRINDER_DEBUG_NOCLEAN"] - @log.debug "Cleaning tmp/work directories" - FileUtils.rm_rf "#{@dir.base}/out" if File.exist? "#{@dir.base}/out" + if File.exist? "#{@dir.base}/out" + @log.debug "Cleaning work directories" + FileUtils.rm_rf "#{@dir.base}/out" + end end end end end