extract #standard_delete_resource

This commit is contained in:
Adam Spiers 2014-02-06 16:21:34 +00:00
parent a01427b697
commit 647fe52079
3 changed files with 10 additions and 10 deletions

View File

@ -52,6 +52,14 @@ class Chef
::Chef::Log.error "Failed to configure #{cib_object}"
end
end
def standard_delete_resource
execute @current_cib_object.delete_command do
action :nothing
end.run_action(:run)
new_resource.updated_by_last_action(true)
Chef::Log.info "Deleted #{@current_cib_object}'."
end
end
end
end

View File

@ -36,11 +36,7 @@ end
action :delete do
name = new_resource.name
next unless @current_resource
execute @current_cib_object.delete_command do
action :nothing
end.run_action(:run)
new_resource.updated_by_last_action(true)
Chef::Log.info "Deleted #{@current_cib_object}'."
standard_delete_resource
end
def cib_object_class

View File

@ -45,11 +45,7 @@ action :delete do
if @current_cib_object.running?
raise "Cannot delete running #{@current_cib_object}"
end
execute @current_cib_object.delete_command do
action :nothing
end.run_action(:run)
new_resource.updated_by_last_action(true)
Chef::Log.info "Deleted #{@current_cib_object}"
standard_delete_resource
end
action :start do