extract #standard_delete_resource
This commit is contained in:
parent
a01427b697
commit
647fe52079
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user