diff options
Diffstat (limited to 'lib/puppet/server/fileserver.rb')
-rwxr-xr-x | lib/puppet/server/fileserver.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/puppet/server/fileserver.rb b/lib/puppet/server/fileserver.rb index aa513d68c..f7a15e6b9 100755 --- a/lib/puppet/server/fileserver.rb +++ b/lib/puppet/server/fileserver.rb @@ -42,6 +42,7 @@ class Server end def describe(file, client = nil, clientip = nil) + readconfig mount, path = splitpath(file) unless @mounts[mount].allowed?(client, clientip) @@ -97,7 +98,9 @@ class Server @noreadconfig = false end + @configtimeout = hash[:ConfigTimeout] || 60 @configstamp = nil + @congigstatted = nil if hash.include?(:Mount) @passedconfig = true @@ -118,6 +121,7 @@ class Server end def list(dir, recurse = false, client = nil, clientip = nil) + readconfig mount, path = splitpath(dir) unless @mounts[mount].allowed?(client, clientip) @@ -177,6 +181,17 @@ class Server def readconfig return if @noreadconfig + if @configstamp and FileTest.exists?(@config) + if @configtimeout and @configstatted and + (Time.now - @configstatted > @configtimeout) + tmp = File.stat(@config).ctime + + if tmp == @configstamp + return + end + end + end + @mounts.clear begin @@ -245,9 +260,13 @@ class Server rescue Errno::ENOENT => detail raise Puppet::Error, "%s does not exit" % @config end + + @configstamp = File.stat(@config).ctime + @configstatted = Time.now end def retrieve(file, client = nil, clientip = nil) + readconfig mount, path = splitpath(file) unless (@mounts.include?(mount)) |