diff options
author | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 15:43:07 -0700 |
---|---|---|
committer | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 15:43:07 -0700 |
commit | 9792915481ed757c56768f8f5e4fd100217b7232 (patch) | |
tree | 84963bae95d4b9179c88fd00999b72520860284d /lib | |
parent | 9ee4c2dc06aee189994e3e06910e52bced4c6854 (diff) | |
download | puppet-9792915481ed757c56768f8f5e4fd100217b7232.tar.gz puppet-9792915481ed757c56768f8f5e4fd100217b7232.tar.xz puppet-9792915481ed757c56768f8f5e4fd100217b7232.zip |
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 <luke@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/type/yumrepo.rb | 26 |
1 files changed, 1 insertions, 25 deletions
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 |