]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/definitions/munin_plugin.rb
Revert "Make an EditedFile look like a string"
[chef.git] / cookbooks / munin / definitions / munin_plugin.rb
index a44da4f1e2154a9db8827e0e17f7498c03325f01..4704313b7a67fbc03b3986242ff0de2b076cb228 100644 (file)
@@ -20,7 +20,9 @@
 define :munin_plugin, :action => :create do
   target = params[:target] || params[:name]
 
-  if File.exists?("/usr/local/share/munin/plugins/#{target}")
+  if File.exists?(target)
+    target_path = target
+  elsif File.exists?("/usr/local/share/munin/plugins/#{target}")
     target_path = "/usr/local/share/munin/plugins/#{target}"
   elsif File.exists?("/usr/share/munin/plugins/#{target}")
     target_path = "/usr/share/munin/plugins/#{target}"
@@ -36,7 +38,7 @@ define :munin_plugin, :action => :create do
     link "/etc/munin/plugins/#{params[:name]}" do
       action params[:action]
       to target_path
-      notifies :restart, resources(:service => "munin-node")
+      notifies :restart, "service[munin-node]"
     end
   end