summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2010-05-17 12:28:19 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitd13f8ac4d5b8e4cf677c6c04fe875630216d6303 (patch)
treee8864cc0bf9ba027138c72726704a05b92bf79c5
parent89e8745e8c5c69775f8e1f680dceb39ba7a985ee (diff)
downloadpuppet-d13f8ac4d5b8e4cf677c6c04fe875630216d6303.tar.gz
puppet-d13f8ac4d5b8e4cf677c6c04fe875630216d6303.tar.xz
puppet-d13f8ac4d5b8e4cf677c6c04fe875630216d6303.zip
Fixing #3671 - --compile Catalogs are pretty-printed
A simple fix for this one. This doesn't fix the general case, just the --compile case. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
-rw-r--r--lib/puppet/application/master.rb2
-rw-r--r--spec/unit/application/master.rb11
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/puppet/application/master.rb b/lib/puppet/application/master.rb
index 2433780c2..44c8c027b 100644
--- a/lib/puppet/application/master.rb
+++ b/lib/puppet/application/master.rb
@@ -59,7 +59,7 @@ class Puppet::Application::Master < Puppet::Application
raise "Could not compile catalog for %s" % options[:node]
end
- $stdout.puts catalog.render(:pson)
+ jj catalog.to_resource
rescue => detail
$stderr.puts detail
exit(30)
diff --git a/spec/unit/application/master.rb b/spec/unit/application/master.rb
index 362769e53..ff0c1994c 100644
--- a/spec/unit/application/master.rb
+++ b/spec/unit/application/master.rb
@@ -287,6 +287,7 @@ describe Puppet::Application::Master do
Puppet.stubs(:[]).with(:environment)
Puppet.stubs(:[]).with(:manifest).returns("site.pp")
Puppet.stubs(:err)
+ @master.stubs(:jj)
@master.stubs(:exit)
Puppet.features.stubs(:pson?).returns true
end
@@ -304,13 +305,15 @@ describe Puppet::Application::Master do
@master.compile
end
- it "should render the catalog to pson and print the output" do
- @master.options[:node] = "foo"
+ it "should convert the catalog to a pure-resource catalog and use 'jj' to pretty-print the catalog" do
catalog = Puppet::Resource::Catalog.new
- catalog.expects(:render).with(:pson).returns "mypson"
Puppet::Resource::Catalog.expects(:find).returns catalog
- $stdout.expects(:puts).with("mypson")
+ catalog.expects(:to_resource).returns("rescat")
+
+ @master.options[:node] = "foo"
+ @master.expects(:jj).with("rescat")
+
@master.compile
end