summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/formats.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-09-23 23:50:43 -0500
committerLuke Kanies <luke@madstop.com>2008-09-23 23:50:43 -0500
commitbb23861e334e617b544c11bc75a35c40b36185a2 (patch)
tree18da91858e4fded78a56d673fc69014fdf266676 /lib/puppet/network/formats.rb
parente31df2f7f5e98c524b68cd724cfaa3e308e7b9a1 (diff)
parentac5db5ec115455e54090542870847820357739a2 (diff)
downloadpuppet-bb23861e334e617b544c11bc75a35c40b36185a2.tar.gz
puppet-bb23861e334e617b544c11bc75a35c40b36185a2.tar.xz
puppet-bb23861e334e617b544c11bc75a35c40b36185a2.zip
Merge branch 'feature/master/1481'
This merges in the new fileserving code -- we're now using REST to do fileserving, rather than xmlrpc. Conflicts: lib/puppet/parameter.rb lib/puppet/type/file.rb spec/unit/type/file.rb
Diffstat (limited to 'lib/puppet/network/formats.rb')
-rw-r--r--lib/puppet/network/formats.rb23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/puppet/network/formats.rb b/lib/puppet/network/formats.rb
index 8e4c59fb3..85e8ce6f8 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,24 @@ Puppet::Network::FormatHandler.create(:marshal, :mime => "text/marshal") do
end
Puppet::Network::FormatHandler.create(:s, :mime => "text/plain")
+
+# A very low-weight format so it'll never get chosen automatically.
+Puppet::Network::FormatHandler.create(:raw, :mime => "application/x-raw", :weight => 1) 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