fields = trigger_info(os.getenv('TRIGGER_INFO'))
# Check if we've got required fields in TRIGGER_INFO
- for field in ('kickstart', 'name', 'buildid', 'repo_path', 'download_num'):
+ for field in ('kickstart', 'name', 'buildid', 'repo_path'):
if field not in fields:
print 'Error: TRIGGER_INFO doesn\'t contain %s'
return 1
"name": fields['name'],
"project": fields.get('project', ''),
"status": "failed",
- "url": url,
- "download_num": int(fields['download_num'])
+ "url": url
}
+ if "download_num" in fields:
+ data["download_num"] = int(fields['download_num'])
trigger_next("POST-IMAGE-CREATION", data)
ksf = os.path.join(outdir, '%s.ks' % name)
"name": fields['name'],
"project": fields.get('project', ''),
"status": status,
- "url": url,
- "download_num": int(fields['download_num'])
+ "url": url
}
+ if "download_num" in fields:
+ data["download_num"] = int(fields['download_num'])
trigger_next("POST-IMAGE-CREATION", data)