diff --git a/awx/main/serializers.py b/awx/main/serializers.py index de4484fc31..629697230d 100644 --- a/awx/main/serializers.py +++ b/awx/main/serializers.py @@ -377,7 +377,8 @@ class JobSerializer(BaseSerializer): 'forks', 'limit', 'verbosity', 'extra_vars', 'job_tags', 'launch_type', 'status', 'failed', 'result_stdout', 'result_traceback', - 'passwords_needed_to_start') + 'passwords_needed_to_start', 'job_args', + 'job_cwd', 'job_env') def get_related(self, obj): res = super(JobSerializer, self).get_related(obj) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 97bdba6089..5afd37ec16 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -205,8 +205,8 @@ class RunJob(Task): raise RuntimeError('project local_path %s cannot be found in %s' % (job.project.local_path, root)) env = self.build_env(job, **kwargs) - job = self.update_job(job_pk, job_args=args, job_cwd=cwd, - job_env=env) + job = self.update_job(job_pk, job_args=json.dumps(args), + job_cwd=cwd, job_env=env) status, stdout = self.run_pexpect(job_pk, args, cwd, env, kwargs['passwords']) except Exception: