diff options
| author | Luke Kanies <luke@madstop.com> | 2008-04-11 11:34:51 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-04-11 11:34:51 -0500 |
| commit | 4aaad26509b2dc9bd45782ec45231e6ea53a4a37 (patch) | |
| tree | e0715ba0328f149bf030b63a9ce30e3fb57a5d26 /lib/puppet/network/handler/master.rb | |
| parent | 2925ad1cb9aa820785afca58c4fb6e34274dadd4 (diff) | |
| download | puppet-4aaad26509b2dc9bd45782ec45231e6ea53a4a37.tar.gz puppet-4aaad26509b2dc9bd45782ec45231e6ea53a4a37.tar.xz puppet-4aaad26509b2dc9bd45782ec45231e6ea53a4a37.zip | |
Modified the 'master' handler to use the Catalog class to
compile node configurations, rather than using the Configuration
handler, which was never used directly. I removed the Configuration
handler as a result.
Modified the 'master' handler (responsible for sending configurations
to clients) to always return Time.now as its compile date, so
configurations will always get recompiled.
Diffstat (limited to 'lib/puppet/network/handler/master.rb')
| -rw-r--r-- | lib/puppet/network/handler/master.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index dabfaca50..851ccc7b2 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -23,8 +23,8 @@ class Puppet::Network::Handler # Tell a client whether there's a fresh config for it def freshness(client = nil, clientip = nil) - client ||= Facter.value("hostname") - config_handler.version(client, clientip) + # Always force a recompile. Newer clients shouldn't do this (as of April 2008). + Time.now end def initialize(hash = {}) @@ -51,8 +51,6 @@ class Puppet::Network::Handler if hash.include?(:Classes) args[:Classes] = hash[:Classes] end - - @config_handler = Puppet::Network::Handler.handler(:configuration).new(args) end # Call our various handlers; this handler is getting deprecated. @@ -63,13 +61,9 @@ class Puppet::Network::Handler # Pass the facts to the fact handler Puppet::Node::Facts.new(client, facts).save unless local? - # And get the configuration from the config handler - config = nil - benchmark(:notice, "Compiled configuration for %s" % client) do - config = config_handler.configuration(client) - end + catalog = Puppet::Node::Catalog.find(client) - return translate(config.extract) + return translate(catalog.extract) end private @@ -93,13 +87,6 @@ class Puppet::Network::Handler return client, clientip end - def config_handler - unless defined? @config_handler - @config_handler = Puppet::Network::Handler.handler(:config).new :local => local? - end - @config_handler - end - # def decode_facts(facts) if @local |
