added a comment - - edited
i have installed chef-0.9.14 but I don't default action support, I also have checked source code and noticed that announced changes are not here:
wget https://github.com/avishai-ish-shalom/chef/raw/8c7d11bd3be81c6fc8e1e15137ac7957092cbeab/chef/lib/chef/resource.rb > /tmp/foo.rb
diff -u /usr/local/lib64/ruby/gems/1.8/gems/chef-0.9.14/lib/chef/resource.rb /tmp/foo.rb
— /usr/local/lib64/ruby/gems/1.8/gems/chef-0.9.14/lib/chef/resource.rb 2011-03-28 13:58:16.000000000 +0400
+++ /tmp/foo.rb 2011-03-28 14:09:11.000000000 +0400
@@ -459,11 +459,17 @@
class << cls
include Chef::Mixin::FromFile
+ attr_reader :default_action
+
def actions_to_create
@actions_to_create
end
define_method(:actions) do |*action_names|
+ if action_names.last.is_a? Hash
+ action_options = action_names.pop
+ @default_action = action_options[:default] if action_options.has_key? :default
+ end
actions_to_create.push(*action_names)
end
end
@@ -479,6 +485,7 @@
args_run_context = optional_args.shift
@resource_name = rname.to_sym
old_init.bind(self).call(name, args_run_context)
+ @action = self.class.default_action
allowed_actions.push(self.class.actions_to_create).flatten!
end
end
https://github.com/avishai-ish-shalom/chef/tree/CHEF-1789
actions :create, :delete, :default => :create:default => :action options Hash must be the last argument.