A simple fix for this one. This doesn't fix the general case, just the --compile case.
Signed-off-by: Luke Kanies <[email protected]> --- lib/puppet/application/server.rb | 2 +- spec/unit/application/server.rb | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/puppet/application/server.rb b/lib/puppet/application/server.rb index 7aeb6ad..275646a 100644 --- a/lib/puppet/application/server.rb +++ b/lib/puppet/application/server.rb @@ -59,7 +59,7 @@ Puppet::Application.new(:server) do 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/server.rb b/spec/unit/application/server.rb index b300e94..3cfd26f 100644 --- a/spec/unit/application/server.rb +++ b/spec/unit/application/server.rb @@ -287,6 +287,7 @@ describe "PuppetMaster" do Puppet.stubs(:[]).with(:environment) Puppet.stubs(:[]).with(:manifest).returns("site.pp") Puppet.stubs(:err) + @server_app.stubs(:jj) @server_app.stubs(:exit) Puppet.features.stubs(:pson?).returns true end @@ -304,13 +305,15 @@ describe "PuppetMaster" do @server_app.compile end - it "should render the catalog to pson and print the output" do - @server_app.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") + + @server_app.options[:node] = "foo" + @server_app.expects(:jj).with("rescat") + @server_app.compile end -- 1.6.1 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
