extract #standard_create_action for reuse
This commit is contained in:
@@ -7,6 +7,16 @@ require ::File.expand_path('../../../pacemaker/cib_object',
|
||||
class Chef
|
||||
module Mixin::Pacemaker
|
||||
module StandardCIBObject
|
||||
def standard_create_action
|
||||
name = new_resource.name
|
||||
|
||||
if @current_resource_definition.nil?
|
||||
create_resource(name)
|
||||
else
|
||||
maybe_modify_resource(name)
|
||||
end
|
||||
end
|
||||
|
||||
# Instantiate @current_resource and read details about the existing
|
||||
# primitive (if any) via "crm configure show" into it, so that we
|
||||
# can compare it against the resource requested by the recipe, and
|
||||
|
@@ -23,13 +23,7 @@ require ::File.expand_path('../libraries/chef/mixin/pacemaker',
|
||||
include Chef::Mixin::Pacemaker::RunnableResource
|
||||
|
||||
action :create do
|
||||
name = new_resource.name
|
||||
|
||||
if @current_resource_definition.nil?
|
||||
create_resource(name)
|
||||
else
|
||||
maybe_modify_resource(name)
|
||||
end
|
||||
standard_create_action
|
||||
end
|
||||
|
||||
action :delete do
|
||||
|
Reference in New Issue
Block a user