lib/cap-rightscale/recipes/rightscale/cache.rb in cap-rightscale-0.0.12 vs lib/cap-rightscale/recipes/rightscale/cache.rb in cap-rightscale-0.1.0
- old
+ new
@@ -5,11 +5,12 @@
end
desc "Clear rightscale's server list cache"
namespace :cache do
task :clear do
- puts "Clear cache all"
- pp Dir.glob("#{Dir.tmpdir}/cap-rightscale-*/#{stage}*")
- FileUtils.rm(Dir.glob("#{Dir.tmpdir}/cap-rightscale-*/#{stage}*"), {:force => true})
+ logger.info("Clear cache all")
+ pp Dir.glob("#{Dir.tmpdir}/cap-rightscale-#{ENV['USER']}-*/#{stage}*")
+ prefix = stage ? "#{stage}" : "default"
+ FileUtils.rm(Dir.glob("#{Dir.tmpdir}/cap-rightscale-#{ENV['USER']}-*/#{prefix}*"), {:force => true})
end
end
end