remove broken mixing in of load_current_resource

load_current_resource falls victim to pitfall no.1 of mixins :-(

http://definingterms.com/2013/03/23/pitfalls-of-ruby-mixins/
This commit is contained in:
Adam Spiers 2014-02-04 19:08:08 +00:00
parent fe5616cfca
commit 247e5f788b
3 changed files with 9 additions and 1 deletions

View File

@ -47,6 +47,10 @@ def cib_object_class
Pacemaker::Constraint::Colocation
end
def load_current_resource
standard_load_current_resource
end
def init_current_resource
name = @new_resource.name
@current_resource = Chef::Resource::PacemakerColocation.new(name)

View File

@ -9,7 +9,7 @@ class Chef
# create / delete / modify as necessary.
#
# http://docs.opscode.com/lwrp_custom_provider_ruby.html#load-current-resource
def load_current_resource
def standard_load_current_resource
name = @new_resource.name
cib_object = Pacemaker::CIBObject.from_name(name)

View File

@ -84,6 +84,10 @@ def cib_object_class
Pacemaker::Resource::Primitive
end
def load_current_resource
standard_load_current_resource
end
def init_current_resource
name = @new_resource.name
@current_resource = Chef::Resource::PacemakerPrimitive.new(name)