From 71ecad9904c8c48c023e90e5fbea5b26b180c9cf Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Mon, 29 Nov 2010 11:56:40 -0800 Subject: Maint: Refactor code to use .indirection. Replaced uses of the find, search, destroy, and expire methods on model classes with direct calls to the indirection objects. Also removed the old methods that delegated to the indirection object. --- lib/puppet/node/facts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/node') diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb index d84d54113..612dc3239 100755 --- a/lib/puppet/node/facts.rb +++ b/lib/puppet/node/facts.rb @@ -16,7 +16,7 @@ class Puppet::Node::Facts # We want to expire any cached nodes if the facts are saved. module NodeExpirer def save(key, instance) - Puppet::Node.expire(instance.name) + Puppet::Node.indirection.expire(instance.name) super end end -- cgit From 3063000155ddc475d1703d10cfc13770f687c3b2 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Mon, 29 Nov 2010 14:52:26 -0800 Subject: Maint: Swap the order of arguments to Indirection#save The first argument was often nil, and the second was mandatory. --- lib/puppet/node/facts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/node') diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb index 612dc3239..fd99adc3b 100755 --- a/lib/puppet/node/facts.rb +++ b/lib/puppet/node/facts.rb @@ -15,7 +15,7 @@ class Puppet::Node::Facts # We want to expire any cached nodes if the facts are saved. module NodeExpirer - def save(key, instance) + def save(instance, key) Puppet::Node.indirection.expire(instance.name) super end -- cgit From 7de6af87109062a4c0b038f2f2d93191e6a93e4f Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Tue, 30 Nov 2010 11:59:45 -0800 Subject: Maint: Add a default value for key in Facts::NodeExpirer#save Changed to match the signature of the method being overridden. This will allow code to call Facts.indirection.save() without a key. --- lib/puppet/node/facts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/node') diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb index fd99adc3b..451813f7d 100755 --- a/lib/puppet/node/facts.rb +++ b/lib/puppet/node/facts.rb @@ -15,7 +15,7 @@ class Puppet::Node::Facts # We want to expire any cached nodes if the facts are saved. module NodeExpirer - def save(instance, key) + def save(instance, key = nil) Puppet::Node.indirection.expire(instance.name) super end -- cgit