Browse files

try to make the logic more robust

  • Loading branch information...
1 parent e55f79b commit 3ff683e1e4e7bbd81247773e6ffd3520750a7918 @pulkitsinghal committed May 27, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 definitions/install_plugin.rb
View
9 definitions/install_plugin.rb
@@ -5,15 +5,14 @@
bash "/usr/local/bin/plugin -install #{params[:name]}" do
user "root"
code "/usr/local/bin/plugin -install #{params[:name]}"
-
notifies :restart, resources(:service => 'elasticsearch')
-
not_if do
Dir.entries("#{node.elasticsearch[:dir]}/elasticsearch-#{node.elasticsearch[:version]}/plugins/").any? do |plugin|
+ begin
params[:name].include? plugin
- end rescue false
+ rescue
+ false
+ end
end
-
end
-
end

0 comments on commit 3ff683e

Please sign in to comment.