lib/elecksee/storage/overlay_directory.rb in elecksee-1.0.6 vs lib/elecksee/storage/overlay_directory.rb in elecksee-1.0.8

- old
+ new

@@ -4,10 +4,12 @@ class OverlayDirectory attr_reader :name attr_reader :tmp_dir + include Helpers + def initialize(name, args={}) @name = name @tmp_dir = args[:tmp_dir] || '/tmp/lxc/ephemerals' create end @@ -22,10 +24,12 @@ FileUtils.mkdir_p(overlay_path) end end def destroy - FileUtils.rm_rf(overlay_path) if File.directory?(overlay_path) + if(File.directory?(overlay_path)) + command("rm -rf #{overlay_path}", :sudo => true) + end end end end