mirror of
https://github.com/inspec/inspec
synced 2024-11-15 09:27:20 +00:00
CFINSPEC-68 Adds target_id in the reporter under platform data.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
parent
9fe26f4bc9
commit
2561fd3b43
3 changed files with 3 additions and 2 deletions
|
@ -73,6 +73,7 @@ module Inspec::Formatters
|
|||
name: platform(:name),
|
||||
release: platform(:release),
|
||||
target: backend_target,
|
||||
target_id: platform(:uuid),
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ module Inspec::Reporters
|
|||
final_report[:type] = "inspec_report"
|
||||
|
||||
final_report[:end_time] = Time.now.utc.strftime("%FT%TZ")
|
||||
final_report[:node_uuid] = @config["node_uuid"] || @config["target_id"]
|
||||
final_report[:node_uuid] = report[:platform][:target_id] || @config["node_uuid"] || @config["target_id"]
|
||||
raise Inspec::ReporterError, "Cannot find a UUID for your node. Please specify one via json-config." if final_report[:node_uuid].nil?
|
||||
|
||||
final_report[:report_uuid] = @config["report_uuid"] || uuid_from_string(final_report[:end_time] + final_report[:node_uuid])
|
||||
|
|
|
@ -29,7 +29,7 @@ module Inspec::Reporters
|
|||
{
|
||||
name: run_data[:platform][:name],
|
||||
release: run_data[:platform][:release],
|
||||
target_id: @config["target_id"],
|
||||
target_id: run_data[:platform][:target_id] || @config["target_id"],
|
||||
}.reject { |_k, v| v.nil? }
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue