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}"
|
::Chef::Log.error "Failed to configure #{cib_object}"
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -36,11 +36,7 @@ end
|
|||||||
action :delete do
|
action :delete do
|
||||||
name = new_resource.name
|
name = new_resource.name
|
||||||
next unless @current_resource
|
next unless @current_resource
|
||||||
execute @current_cib_object.delete_command do
|
standard_delete_resource
|
||||||
action :nothing
|
|
||||||
end.run_action(:run)
|
|
||||||
new_resource.updated_by_last_action(true)
|
|
||||||
Chef::Log.info "Deleted #{@current_cib_object}'."
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def cib_object_class
|
def cib_object_class
|
||||||
|
@ -45,11 +45,7 @@ action :delete do
|
|||||||
if @current_cib_object.running?
|
if @current_cib_object.running?
|
||||||
raise "Cannot delete running #{@current_cib_object}"
|
raise "Cannot delete running #{@current_cib_object}"
|
||||||
end
|
end
|
||||||
execute @current_cib_object.delete_command do
|
standard_delete_resource
|
||||||
action :nothing
|
|
||||||
end.run_action(:run)
|
|
||||||
new_resource.updated_by_last_action(true)
|
|
||||||
Chef::Log.info "Deleted #{@current_cib_object}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
action :start do
|
action :start do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user