summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/client
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-07-29 00:46:11 -0500
committerLuke Kanies <luke@madstop.com>2008-07-29 00:46:11 -0500
commit40375a8fc34dbd85d87f507ba72c7394b25b7271 (patch)
treeefd5a93980b042b73322bd31e6fdb41203d07576 /lib/puppet/network/client
parent93eeff59d807261ed154cc104e318ae604602430 (diff)
parent8f5800f0608dff46407cb5f23ee73f314fe051e8 (diff)
downloadpuppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.tar.gz
puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.tar.xz
puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.zip
Merge branch '0.24.x' into merging
Conflicts: test/ral/type/filesources.rb
Diffstat (limited to 'lib/puppet/network/client')
-rw-r--r--lib/puppet/network/client/master.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index 26eff52a0..d401cd393 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -142,15 +142,20 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
# If we can't retrieve the catalog, just return, which will either
# fail, or use the in-memory catalog.
- unless yaml_objects = get_actual_config(facts)
+ unless marshalled_objects = get_actual_config(facts)
use_cached_config(true)
return
end
begin
- objects = YAML.load(yaml_objects)
+ case Puppet[:catalog_format]
+ when "marshal": objects = Marshal.load(marshalled_objects)
+ when "yaml": objects = YAML.load(marshalled_objects)
+ else
+ raise "Invalid catalog format '%s'" % Puppet[:catalog_format]
+ end
rescue => detail
- msg = "Configuration could not be translated from yaml"
+ msg = "Configuration could not be translated from %s" % Puppet[:catalog_format]
msg += "; using cached catalog" if use_cached_config(true)
Puppet.warning msg
return
@@ -174,7 +179,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
end
if ! @catalog.from_cache
- self.cache(yaml_objects)
+ self.cache(marshalled_objects)
end
# Keep the state database up to date.
@@ -441,7 +446,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
benchmark(:debug, "Retrieved catalog") do
# error handling for this is done in the network client
begin
- textobjects = @driver.getconfig(textfacts, "yaml")
+ textobjects = @driver.getconfig(textfacts, Puppet[:catalog_format])
begin
textobjects = CGI.unescape(textobjects)
rescue => detail