From 9792915481ed757c56768f8f5e4fd100217b7232 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 12 Apr 2010 15:43:07 -0700 Subject: Fixing yumrepo type to use 'flush' It was previously relying on monkey-patching the last 'Change' instance in 'evaluate', but we removed 'evaluate', so this wasn't working any more. Signed-off-by: Luke Kanies --- lib/puppet/type/yumrepo.rb | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb index 51ed17bff..018fd053c 100644 --- a/lib/puppet/type/yumrepo.rb +++ b/lib/puppet/type/yumrepo.rb @@ -203,32 +203,8 @@ module Puppet self.class.section(self[:name]) end - def evaluate - changes = super - # FIXME: Dirty, dirty hack - # We amend the go method of the last change to trigger - # writing the whole file - # A cleaner solution would be to either use the composite - # pattern and encapsulate all changes into a change that does - # not depend on a property and triggers storing, or insert another - # change at the end of changes to trigger storing Both - # solutions require that the PropertyChange interface be - # abstracted so that it can work with a change that is not - # directly backed by a Property - unless changes.empty? - class << changes[-1] - def go - result = super - self.property.resource.store - return result - end - end - end - return changes - end - # Store modifications to this yumrepo resource back to disk - def store + def flush self.class.store end -- cgit