Function Name: Ansible Tower List Job Templates
Issue: Some elements of the results from restful call response doesn't has a project name information, but as per the current code if project name info is mandatory.
Modification: Changed the code to handle the situation when project information is not available, filling those project name column with null values.
Error Code Line:
return [project for project in results if compiled.match(project['summary_fields']['project']['name'])]
Fixed Line code:
pro_list = []
for project in results:
pro_name = project.get("summary_fields", {}).get("project", {}).get("name", None)
if pro_name:
if compiled.match(pro_name):
pro_list.append(project)
return pro_list
Ansible Tower Run Job - Incident
Post process script modified. to handle if any result key is not available
Ansible Tower Run Job - Datatable
Post process script modified. to handle if any result key is not available
Ansible Tower Run Job - Artifact
Post process script modified. to handle if any result key is not available
Ansible Tower Get job results
Post process script modified. Currently for notes & attachments save as type its only executing notes section. modified to execute defined sections bases on save as type.
Modifications:
Function Name: Ansible Tower List Job Templates Issue: Some elements of the results from restful call response doesn't has a project name information, but as per the current code if project name info is mandatory. Modification: Changed the code to handle the situation when project information is not available, filling those project name column with null values. Error Code Line: return [project for project in results if compiled.match(project['summary_fields']['project']['name'])]
Fixed Line code: pro_list = [] for project in results: pro_name = project.get("summary_fields", {}).get("project", {}).get("name", None) if pro_name: if compiled.match(pro_name): pro_list.append(project) return pro_list
Ansible Tower Run Job - Incident
Ansible Tower Run Job - Datatable
Ansible Tower Run Job - Artifact
Ansible Tower Get job results Post process script modified. Currently for notes & attachments save as type its only executing notes section. modified to execute defined sections bases on save as type.