546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
|
# File 'lib/chef/node.rb', line 546
def for_json
result = {
"name" => name,
"chef_environment" => chef_environment,
"json_class" => self.class.name,
"automatic" => attributes.automatic.to_hash,
"normal" => attributes.normal.to_hash,
"chef_type" => "node",
"default" => attributes.combined_default.to_hash,
"override" => attributes.combined_override.to_hash,
"run_list" => @primary_runlist.run_list.map(&:to_s),
}
unless policy_group.nil? && policy_name.nil?
result["policy_name"] = policy_name
result["policy_group"] = policy_group
end
result
end
|