mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
Merge pull request #131 from ryanpetrello/fix-7337
fix a bug which breaks inventory update stdout downloads
This commit is contained in:
@@ -4376,7 +4376,14 @@ class UnifiedJobStdout(RetrieveAPIView):
|
|||||||
tablename, related_name = {
|
tablename, related_name = {
|
||||||
Job: ('main_jobevent', 'job_id'),
|
Job: ('main_jobevent', 'job_id'),
|
||||||
AdHocCommand: ('main_adhoccommandevent', 'ad_hoc_command_id'),
|
AdHocCommand: ('main_adhoccommandevent', 'ad_hoc_command_id'),
|
||||||
}[unified_job.__class__]
|
}.get(unified_job.__class__, (None, None))
|
||||||
|
if tablename is None:
|
||||||
|
# stdout job event reconstruction isn't supported
|
||||||
|
# for certain job types (such as inventory syncs),
|
||||||
|
# so just grab the raw stdout from the DB
|
||||||
|
write_fd.write(unified_job.result_stdout_text)
|
||||||
|
write_fd.close()
|
||||||
|
else:
|
||||||
cursor.copy_expert(
|
cursor.copy_expert(
|
||||||
"copy (select stdout from {} where {}={} order by start_line) to stdout".format(
|
"copy (select stdout from {} where {}={} order by start_line) to stdout".format(
|
||||||
tablename,
|
tablename,
|
||||||
|
|||||||
Reference in New Issue
Block a user