vendored/puppet/lib/puppet/network/http/api/master/v3/environment.rb in bolt-0.20.3 vs vendored/puppet/lib/puppet/network/http/api/master/v3/environment.rb in bolt-0.20.5

- old
+ new

@@ -1,6 +1,6 @@ -require 'json' +require 'puppet/util/json' require 'puppet/parser/environment_compiler' class Puppet::Network::HTTP::API::Master::V3::Environment def call(request, response) env_name = request.routing_path.split('/').last @@ -13,10 +13,10 @@ catalog = Puppet::Parser::EnvironmentCompiler.compile(env, code_id).to_resource env_graph = build_environment_graph(catalog) - response.respond_with(200, "application/json", JSON.dump(env_graph)) + response.respond_with(200, "application/json", Puppet::Util::Json.dump(env_graph)) end def build_environment_graph(catalog) # This reads catalog and code_id off the catalog rather than using the one # from the request. There shouldn't really be a case where the two differ,