Fix munin_plugin resource
authorTom Hughes <tom@compton.nu>
Sun, 19 Nov 2017 20:58:08 +0000 (20:58 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 19 Nov 2017 20:58:27 +0000 (20:58 +0000)
cookbooks/munin/resources/plugin.rb

index f62f2ac..876468f 100644 (file)
@@ -68,10 +68,10 @@ action_class do
   def target_path
     if ::File.exist?(target)
       target
-    elsif ::File.exist?("/usr/local/share/munin/plugins/#{new_resource.target}")
-      "/usr/local/share/munin/plugins/#{new_resource.target}"
-    elsif ::File.exist?("/usr/share/munin/plugins/#{new_resource.target}")
-      "/usr/share/munin/plugins/#{new_resource.target}"
+    elsif ::File.exist?("/usr/local/share/munin/plugins/#{target}")
+      "/usr/local/share/munin/plugins/#{target}"
+    elsif ::File.exist?("/usr/share/munin/plugins/#{target}")
+      "/usr/share/munin/plugins/#{target}"
     end
   end