diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-18 21:30:56 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-18 21:30:56 +0000 |
| commit | 0cb51f3f7fb442b1b915523c93461b9a24febacb (patch) | |
| tree | 578660289fa846e32450ff36e6ea5d524e7ba180 /lib/puppet/server | |
| parent | f49b1030fc6f81c1776e09d8ce5e9134c828a77a (diff) | |
Fixing a small checksumming bug, reorganizing the client stuff a bit, and adding freshness checking for the configuration, so the config is recompiled every time nor is it downloaded unless it has been recompiled
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@845 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/server')
| -rw-r--r-- | lib/puppet/server/master.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/puppet/server/master.rb b/lib/puppet/server/master.rb index 8d4ddbfde..1b9883ead 100644 --- a/lib/puppet/server/master.rb +++ b/lib/puppet/server/master.rb @@ -14,8 +14,26 @@ class Server @interface = XMLRPC::Service::Interface.new("puppetmaster") { |iface| iface.add_method("string getconfig(string)") + iface.add_method("int freshness()") } + def filetimeout + @interpreter.filetimeout + end + + def filetimeout=(int) + @interpreter.filetimeout = int + end + + # Tell a client whether there's a fresh config for it + def freshness(client = nil, clientip = nil) + if defined? @interpreter + return @interpreter.parsedate + else + return 0 + end + end + def initialize(hash = {}) # FIXME this should all be s/:File/:Manifest/g or something @@ -35,9 +53,11 @@ class Server @ca = nil end + @parsecheck = hash[:FileTimeout] || 15 + Puppet.debug("Creating interpreter") - args = {:Manifest => @file} + args = {:Manifest => @file, :ParseCheck => @parsecheck} if hash.include?(:UseNodes) args[:UseNodes] = hash[:UseNodes] |
