Skip to content

Instantly share code, notes, and snippets.

@fujin
Created February 6, 2012 20:20
Show Gist options
  • Save fujin/1754571 to your computer and use it in GitHub Desktop.
Save fujin/1754571 to your computer and use it in GitHub Desktop.
Passing args to a handler
[Mon, 06 Feb 2012 19:59:35 +0000] INFO: Processing chef_handler[Medidata::RunLoggerHandler] action enable (mdsol_oq::default line 60)
[Mon, 06 Feb 2012 19:59:35 +0000] ERROR: chef_handler[Medidata::RunLoggerHandler] (mdsol_oq::default line 60) has had an error
[Mon, 06 Feb 2012 19:59:35 +0000] ERROR: chef_handler[Medidata::RunLoggerHandler] (/var/cache/chef/cookbooks/mdsol_oq/recipes/default.rb:60:in `from_file') had an error:
chef_handler[Medidata::RunLoggerHandler] (mdsol_oq::default line 60) had an error: wrong number of arguments (1 for 0)
/var/chef/handlers/runlogger.rb:7:in `initialize'
/var/cache/chef/cookbooks/chef_handler/providers/default.rb:24:in `new'
/var/cache/chef/cookbooks/chef_handler/providers/default.rb:24:in `block in class_from_file'
chef_handler "Medidata::RunLoggerHandler" do
source "/var/chef/handlers/runlogger.rb"
arguments node[:mdsol][:temp_loc]
action :enable
end
chef_handler "Medidata::RunLoggerHandler" do
source "/var/chef/handlers/runlogger.rb"
arguments node[:mdsol][:temp_loc]
action :enable
end
require 'chef/handler'
require 'rubygems'
module Medidata
class RunLoggerHandler < Chef::Handler
attr_accessor :temp_loc
def initialize(temp_loc=nil)
self.temp_loc = temp_loc
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment