From 433a8cbae789cc86eb14bb60884dffda3a659b29 Mon Sep 17 00:00:00 2001 From: Joe Mifsud Date: Thu, 20 Nov 2014 14:56:46 -0800 Subject: [PATCH] Adding nothing action for delayed execution --- libraries/provider_accumulator.rb | 4 ++++ libraries/resource_accumulator.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/provider_accumulator.rb b/libraries/provider_accumulator.rb index c35d2ac..eebc3e4 100644 --- a/libraries/provider_accumulator.rb +++ b/libraries/provider_accumulator.rb @@ -44,6 +44,10 @@ def load_current_resource @current_resource end + def action_nothing + # Noop + end + def action_create resources = run_context.resource_collection.select &new_resource.filter target = run_context.resource_collection.find(new_resource.target) diff --git a/libraries/resource_accumulator.rb b/libraries/resource_accumulator.rb index 6ee918f..f261137 100644 --- a/libraries/resource_accumulator.rb +++ b/libraries/resource_accumulator.rb @@ -29,7 +29,7 @@ def initialize(name, run_context=nil) @resource_name = :accumulator @provider = Chef::Provider::Accumulator @action = :create - @allowed_actions = [:create] + @allowed_actions = [:create, :nothing] def filter(&block) set_or_return(:filter, block, :kind_of => Proc, :required => true)