From 1fc69038a693269b79d435e43be63a604f13b881 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 3 Feb 2017 15:46:16 -0500 Subject: [PATCH] Propogate stdout change to mgmt jobs --- awx/main/tasks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 3f38695cc4..e9205f4187 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1927,6 +1927,15 @@ class RunSystemJob(BaseTask): logger.error("Failed to parse system job: " + str(e)) return args + def get_stdout_handle(self, instance): + stdout_handle = super(RunSystemJob, self).get_stdout_handle(instance) + + def raw_callback(data): + instance_actual = SystemJob.objects.get(pk=instance.pk) + instance_actual.result_stdout_text += data + instance_actual.save() + return OutputEventFilter(stdout_handle, raw_callback=raw_callback) + def build_env(self, instance, **kwargs): env = super(RunSystemJob, self).build_env(instance, **kwargs)