summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-20 12:57:26 -0500
committerLuke Kanies <luke@madstop.com>2008-08-20 12:57:26 -0500
commitc8190421a351ed327361a5daca82441be39ce834 (patch)
tree5eae8eafafacafa817c5e890e03d1a9bcf17358d /lib/puppet/network
parent78bc32d0153dd98fadae99dcd71d26fc97210d3c (diff)
downloadpuppet-c8190421a351ed327361a5daca82441be39ce834.tar.gz
puppet-c8190421a351ed327361a5daca82441be39ce834.tar.xz
puppet-c8190421a351ed327361a5daca82441be39ce834.zip
Fixing the String format (fixes #1522).
The string format no longer provides any support methods, which means that I had to create to_multiple_s and from_multiple_s methods on the SSL classes. I created them in the base class and tested them just in the cert class. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/network')
-rw-r--r--lib/puppet/network/format.rb4
-rw-r--r--lib/puppet/network/formats.rb18
2 files changed, 5 insertions, 17 deletions
diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb
index a4515e39f..5f259fa49 100644
--- a/lib/puppet/network/format.rb
+++ b/lib/puppet/network/format.rb
@@ -61,6 +61,10 @@ class Puppet::Network::Format
klass.instance_methods.include?(render_method)
end
+ def to_s
+ "Puppet::Network::Format[%s]" % name
+ end
+
private
attr_reader :intern_method, :render_method, :intern_multiple_method, :render_multiple_method
diff --git a/lib/puppet/network/formats.rb b/lib/puppet/network/formats.rb
index e11748ce6..8e4c59fb3 100644
--- a/lib/puppet/network/formats.rb
+++ b/lib/puppet/network/formats.rb
@@ -53,20 +53,4 @@ Puppet::Network::FormatHandler.create(:marshal, :mime => "text/marshal") do
end
end
-Puppet::Network::FormatHandler.create(:s, :mime => "text/plain") do
- # For now, use the YAML separator.
- SEPARATOR = "\n---\n"
-
- def intern_multiple(klass, text)
- text.split(SEPARATOR).collect { |inst| intern(klass, inst) }
- end
-
- def render_multiple(instances)
- instances.collect { |inst| render(inst) }.join(SEPARATOR)
- end
-
- # Everything's supported
- def supported?(klass)
- true
- end
-end
+Puppet::Network::FormatHandler.create(:s, :mime => "text/plain")