Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the bug that rabbit doesn't delete instance's logs when unprovision

Change-Id: I0be8277fc4e5e94c2b29c88144b6d3734664ee09
  • Loading branch information...
commit 8d21b0411c7dc96e314a4a39a776aca62e863f05 1 parent 3726feb
@tangr1 tangr1 authored kushmerick committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 rabbit/lib/rabbit_service/rabbit_node.rb
View
6 rabbit/lib/rabbit_service/rabbit_node.rb
@@ -372,7 +372,7 @@ def start_instance(instance)
dir = instance_dir(instance.name)
config_dir = File.join(dir, "config")
- log_dir = File.join(@rabbitmq_log_dir, instance.name)
+ log_dir = instance_log_dir(instance.name)
FileUtils.mkdir_p(config_dir)
FileUtils.mkdir_p(log_dir)
admin_port = instance.admin_port
@@ -451,6 +451,7 @@ def stop_instance(instance)
instance.kill
EM.defer do
FileUtils.rm_rf(instance_dir(instance.name))
+ FileUtils.rm_rf(instance_log_dir(instance.name))
end
end
@@ -532,4 +533,7 @@ def instance_dir(instance_id)
File.join(@base_dir, instance_id)
end
+ def instance_log_dir(instance_id)
+ File.join(@rabbitmq_log_dir, instance_id)
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.