summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/handler/fileserver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/network/handler/fileserver.rb')
-rwxr-xr-xlib/puppet/network/handler/fileserver.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb
index dd00450be..7a5a1fe9a 100755
--- a/lib/puppet/network/handler/fileserver.rb
+++ b/lib/puppet/network/handler/fileserver.rb
@@ -551,22 +551,25 @@ class Puppet::Network::Handler
@path = nil
end
+ @cache = {}
+
super()
end
def fileobj(path, links)
obj = nil
- if obj = Puppet.type(:file)[path]
+ if obj = @cache[path]
# This can only happen in local fileserving, but it's an
# important one. It'd be nice if we didn't just set
# the check params every time, but I'm not sure it's worth
# the effort.
obj[:check] = CHECKPARAMS
else
- obj = Puppet.type(:file).create(
+ obj = Puppet::Type.type(:file).create(
:name => path,
:check => CHECKPARAMS
)
+ @cache[path] = obj
end
if links == :manage