diff options
Diffstat (limited to 'lib/puppet/network/handler')
| -rw-r--r-- | lib/puppet/network/handler/configuration.rb | 6 | ||||
| -rw-r--r-- | lib/puppet/network/handler/master.rb | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/puppet/network/handler/configuration.rb b/lib/puppet/network/handler/configuration.rb index 1dbb16370..05c86f22e 100644 --- a/lib/puppet/network/handler/configuration.rb +++ b/lib/puppet/network/handler/configuration.rb @@ -37,7 +37,9 @@ class Puppet::Network::Handler # Add any external data to the node. add_node_data(node) - return translate(compile(node)) + configuration = compile(node) + + return translate(configuration) end def initialize(options = {}) @@ -214,5 +216,3 @@ class Puppet::Network::Handler end end end - -# $Id$ diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index ace383e9f..18f37ca4a 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -77,7 +77,9 @@ class Puppet::Network::Handler fact_handler.set(client, facts) # And get the configuration from the config handler - return config_handler.configuration(client) + config = config_handler.configuration(client) + + return translate(config.extract) end def local=(val) @@ -139,5 +141,14 @@ class Puppet::Network::Handler end @fact_handler end + + # Translate our configuration appropriately for sending back to a client. + def translate(config) + if local? + config + else + CGI.escape(config.to_yaml(:UseBlock => true)) + end + end end end |
