# File lib/chef/resource.rb, line 370 def run_action(action) # ensure that we don't leave @updated_by_last_action set to true # on accident updated_by_last_action(false) # Check if this resource has an only_if block -- if it does, # evaluate the only_if block and skip the resource if # appropriate. if only_if unless Chef::Mixin::Command.only_if(only_if, only_if_args) Chef::Log.debug("Skipping #{self} due to only_if") return end end # Check if this resource has a not_if block -- if it does, # evaluate the not_if block and skip the resource if # appropriate. if not_if unless Chef::Mixin::Command.not_if(not_if, not_if_args) Chef::Log.debug("Skipping #{self} due to not_if") return end end provider = Chef::Platform.provider_for_resource(self) provider.load_current_resource provider.send("action_#{action}") end