57: def getconfig(facts, format = "marshal", client = nil, clientip = nil)
58: facts = decode_facts(facts)
59:
60: client ||= facts["hostname"]
61:
62:
63: Puppet::Node::Facts.new(client, facts).save unless local?
64:
65: catalog = Puppet::Resource::Catalog.find(client)
66:
67: case format
68: when "yaml"
69: return CGI.escape(catalog.extract.to_yaml(:UseBlock => true))
70: when "marshal"
71: return CGI.escape(Marshal.dump(catalog.extract))
72: else
73: raise "Invalid markup format '%s'" % format
74: end
75: end