/usr/lib/ruby/vendor_ruby/chef_zero/endpoints/node_endpoint.rb is in chef-zero 2.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | require 'json'
require 'chef_zero/endpoints/rest_object_endpoint'
require 'chef_zero/data_normalizer'
module ChefZero
module Endpoints
# /nodes/ID
class NodeEndpoint < RestObjectEndpoint
def populate_defaults(request, response_json)
node = JSON.parse(response_json, :create_additions => false)
node = DataNormalizer.normalize_node(node, request.rest_path[1])
JSON.pretty_generate(node)
end
end
end
end
|