HomePhorge

Remove cached_attrs from Puppet::Type::File
d49dd9ec3ab2Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Remove cached_attrs from Puppet::Type::File

These values needn't be cached_attrs, because they can be managed manually.
'stat' does need to be cached, so that we avoid statting the file for each
property we want to check from disk. The 'content' attribute of 'source' also
needs to be cached, because it's retrieved from the server, which we certainly
don't want to do multiple times.

We need a mechanism for invalidating the 'stat' after we've written the file,
so we use a special value :needs_stat, which essentially represented
"undefined". We use this rather than nil so that we can store a failed stat
if it occurs.

Because the content and metadata of our source file will never change, there is
no need to be able to similarly expire the values of those attributes.

Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
(cherry picked from commit 4b0c847f19d5db81758b5561bdc8196591209ef0)

Conflicts:

lib/puppet/type/file/source.rb

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
Jacob Helwig <jacob@puppetlabs.com>Committed on Aug 19 2011, 10:52 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU546e0f98e3c6: Remove Puppet::Util::Cacher usage from Puppet::Util::Settings
Branches
Unknown
Tags
Unknown

Event Timeline

Jacob Helwig <jacob@puppetlabs.com> committed rPUd49dd9ec3ab2: Remove cached_attrs from Puppet::Type::File (authored by Nick Lewis <nick@puppetlabs.com>).Aug 19 2011, 10:52 PM