Repository: ansible/awx
File: awx/main/tasks/jobs.py (Python)

Code before:
                status = self.instance.status
                raise RuntimeError('not starting %s task' % self.instance.status)

            if not os.path.exists(settings.AWX_ISOLATION_BASE_PATH):
                raise RuntimeError('AWX_ISOLATION_BASE_PATH=%s does not exist' % settings.AWX_ISOLATION_BASE_PATH)

            # May have to serialize the value
            private_data_files, ssh_key_data = self.build_private_data_files(self.instance, private_data_dir)
            passwords = self.build_passwords(self.instance, kwargs)
            self.build_extra_vars_file(self.instance, private_data_dir)
            args = self.build_args(self.instance, private_data_dir, passwords)
            env = self.build_env(self.instance, private_data_dir, private_data_files=private_data_files)
            self.runner_callback.safe_env = build_safe_env(env)

            self.runner_callback.instance = self.instance

            # store a reference to the parent workflow job (if any) so we can include
            # it in event data JSON
            if self.instance.spawned_by_workflow:
                self.runner_callback.parent_workflow_job_id = self.instance.get_workflow_job().id

            self.runner_callback.job_created = str(self.instance.created)

            credentials = self.build_credentials_list(self.instance)

            container_root = ''
            if settings.IS_K8S and isinstance(self.instance, ProjectUpdate):
                container_root = private_data_dir

            for credential in credentials:
                if credential:
                    credential.credential_type.inject_credential(credential, env, self.safe_cred_env, args, private_data_dir, container_root=container_root)

            self.runner_callback.safe_env.update(self.safe_cred_env)

            self.write_args_file(private_data_dir, args)

            password_prompts = self.get_password_prompts(passwords)
            expect_passwords = self.create_expect_passwords_data_struct(password_prompts, passwords)

            params = {
                'ident': self.instance.id,
                'private_data_dir': private_data_dir,
                'playbook': self.build_playbook_path_relative_to_cwd(self.instance, private_data_dir),
                'inventory': self.build_inventory(self.instance, private_data_dir),
                'passwords': expect_passwords,
                'suppress_env_files': getattr(settings, 'AWX_RUNNER_OMIT_ENV_FILES', True),
                'envvars': env,
            }

            if ssh_key_data is not None:

Review comment (suggestion):
```suggestion
            container_root = None
```

Code after:
                status = self.instance.status
                raise RuntimeError('not starting %s task' % self.instance.status)

            if not os.path.exists(settings.AWX_ISOLATION_BASE_PATH):
                raise RuntimeError('AWX_ISOLATION_BASE_PATH=%s does not exist' % settings.AWX_ISOLATION_BASE_PATH)

            # May have to serialize the value
            private_data_files, ssh_key_data = self.build_private_data_files(self.instance, private_data_dir)
            passwords = self.build_passwords(self.instance, kwargs)
            self.build_extra_vars_file(self.instance, private_data_dir)
            args = self.build_args(self.instance, private_data_dir, passwords)
            env = self.build_env(self.instance, private_data_dir, private_data_files=private_data_files)
            self.runner_callback.safe_env = build_safe_env(env)

            self.runner_callback.instance = self.instance

            # store a reference to the parent workflow job (if any) so we can include
            # it in event data JSON
            if self.instance.spawned_by_workflow:
                self.runner_callback.parent_workflow_job_id = self.instance.get_workflow_job().id

            self.runner_callback.job_created = str(self.instance.created)

            credentials = self.build_credentials_list(self.instance)

            container_root = None
            if settings.IS_K8S and isinstance(self.instance, ProjectUpdate):
                container_root = private_data_dir

            for credential in credentials:
                if credential:
                    credential.credential_type.inject_credential(credential, env, self.safe_cred_env, args, private_data_dir, container_root=container_root)

            self.runner_callback.safe_env.update(self.safe_cred_env)

            self.write_args_file(private_data_dir, args)

            password_prompts = self.get_password_prompts(passwords)
            expect_passwords = self.create_expect_passwords_data_struct(password_prompts, passwords)

            params = {
                'ident': self.instance.id,
                'private_data_dir': private_data_dir,
                'playbook': self.build_playbook_path_relative_to_cwd(self.instance, private_data_dir),
                'inventory': self.build_inventory(self.instance, private_data_dir),
                'passwords': expect_passwords,
                'suppress_env_files': getattr(settings, 'AWX_RUNNER_OMIT_ENV_FILES', True),
                'envvars': env,
            }

            if ssh_key_data is not None: