Merge pull request #96 from puppetlabs/dio-911

( DIO-911) Include job_id in ABS --json output
This commit is contained in:
mattkirby 2020-09-17 08:55:43 -07:00 committed by GitHub
commit e34964be00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View file

@ -268,7 +268,7 @@ class ABS
(1..retries).each do |i|
queue_place, res_body = check_queue(conn, saved_job_id, req_obj, verbose)
return translated(res_body) if res_body
return translated(res_body, saved_job_id) if res_body
sleep_seconds = 10 if i >= 10
sleep_seconds = i if i < 10
@ -282,8 +282,8 @@ class ABS
#
# We should fix the ABS API to be more like the vmpooler or nspooler api, but for now
#
def self.translated(res_body)
vmpooler_formatted_body = {}
def self.translated(res_body, job_id)
vmpooler_formatted_body = {'job_id' => job_id}
res_body.each do |host|
if vmpooler_formatted_body[host['type']] && vmpooler_formatted_body[host['type']]['hostname'].class == Array