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