Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fork a process to remove instance directory when unprovision

Change-Id: I949373ac49e51b5e46da80ff455c6138554fceed
  • Loading branch information...
commit 7fa682363558ceca5e68a5d7cb6f49f51dee1a5e 1 parent 6d811f3
@tangr1 tangr1 authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/base/warden.rb
View
11 lib/base/warden.rb
@@ -102,11 +102,14 @@ def delete
# stop container
stop if running?
# delete log and service directory
- if self.class.quota
- FileUtils.rm_rf(image_file)
+ pid = Process.fork do
+ if self.class.quota
+ FileUtils.rm_rf(image_file)
+ end
+ FileUtils.rm_rf(base_dir)
+ FileUtils.rm_rf(log_dir)
end
- FileUtils.rm_rf(base_dir)
- FileUtils.rm_rf(log_dir)
+ Process.detach(pid) if pid
# delete recorder
destroy!
end
Please sign in to comment.
Something went wrong with that request. Please try again.