HomePhorge

Remove cached_attrs from Puppet::Type::File
4b0c847f19d5Unpublished

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>

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUbdcb9be3b5d7: Remove Puppet::Util::Cacher usage from Puppet::Util::Settings
Branches
Unknown
Tags
Unknown

Event Timeline

Nick Lewis <nick@puppetlabs.com> committed rPU4b0c847f19d5: Remove cached_attrs from Puppet::Type::File (authored by Nick Lewis <nick@puppetlabs.com>).Jul 22 2011, 5:10 AM