diff options
author | Bryan McLellan <btm@loftninjas.org> | 2012-01-30 13:39:13 -0800 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2012-01-31 13:18:33 -0800 |
commit | f73211f86616918df2862152ab92778c6917b78b (patch) | |
tree | 4440c5d6137c2fbd003c81d143099b0e39a3e5fc | |
parent | 4d8dd5d8eb7a1993cef08a7b1027106e760595a4 (diff) | |
download | chef-f73211f86616918df2862152ab92778c6917b78b.tar.gz |
chef_gem should run actions immediately during compilation phase
-rw-r--r-- | chef/lib/chef/resource/chef_gem.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/chef/lib/chef/resource/chef_gem.rb b/chef/lib/chef/resource/chef_gem.rb index 8880c627f0..ac279f3572 100644 --- a/chef/lib/chef/resource/chef_gem.rb +++ b/chef/lib/chef/resource/chef_gem.rb @@ -39,7 +39,31 @@ class Chef nil end - + + def action(arg=nil) + if arg + action_list = arg.kind_of?(Array) ? arg : [ arg ] + action_list = action_list.collect { |a| a.to_sym } + action_list.each do |action| + validate( + { + :action => action, + }, + { + :action => { :kind_of => Symbol, :equal_to => @allowed_actions }, + } + ) + end + + # chef_gem actions should run immediately so that the result affects the recipe evaluation + action_list.each do |action| + self.run_action(action) + end + @action = action_list + else + @action + end + end end end end |