summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/network/formats.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/puppet/network/formats.rb b/lib/puppet/network/formats.rb
index 8e4c59fb3..c2a8b7ab6 100644
--- a/lib/puppet/network/formats.rb
+++ b/lib/puppet/network/formats.rb
@@ -42,7 +42,7 @@ Puppet::Network::FormatHandler.create(:marshal, :mime => "text/marshal") do
Marshal.dump(instance)
end
- # Yaml monkey-patches Array, so this works.
+ # Marshal monkey-patches Array, so this works.
def render_multiple(instances)
Marshal.dump(instances)
end
@@ -54,3 +54,23 @@ Puppet::Network::FormatHandler.create(:marshal, :mime => "text/marshal") do
end
Puppet::Network::FormatHandler.create(:s, :mime => "text/plain")
+
+Puppet::Network::FormatHandler.create(:raw, :mime => "application/x-raw") do
+ def intern_multiple(klass, text)
+ raise NotImplementedError
+ end
+
+ def render_multiple(instances)
+ raise NotImplementedError
+ end
+
+ # LAK:NOTE The format system isn't currently flexible enough to handle
+ # what I need to support raw formats just for individual instances (rather
+ # than both individual and collections), but we don't yet have enough data
+ # to make a "correct" design.
+ # So, we hack it so it works for singular but fail if someone tries it
+ # on plurals.
+ def supported?(klass)
+ true
+ end
+end