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