mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Merge pull request #96 from puppetlabs/dio-911
( DIO-911) Include job_id in ABS --json output
This commit is contained in:
commit
e34964be00
3 changed files with 14 additions and 6 deletions
|
|
@ -46,6 +46,10 @@ class Utils
|
|||
|
||||
result = {}
|
||||
|
||||
# ABS has a job_id associated with hosts so pass that along
|
||||
abs_job_id = response_body.delete('job_id')
|
||||
result['job_id'] = abs_job_id unless abs_job_id.nil?
|
||||
|
||||
filtered_response_body = response_body.reject { |key, _| key == 'request_id' || key == 'ready' }
|
||||
filtered_response_body.each do |os, value|
|
||||
hostnames = Array(value['hostname'])
|
||||
|
|
@ -58,7 +62,8 @@ class Utils
|
|||
|
||||
def self.format_host_output(hosts)
|
||||
hosts.flat_map do |os, names|
|
||||
names.map { |name| "- #{name} (#{os})" }
|
||||
# Assume hosts are stored in Arrays and ignore everything else
|
||||
names.map { |name| "- #{name} (#{os})" } if names.is_a? Array
|
||||
end.join("\n")
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue