From 32286a9d49ae7ee22cebba03d758576fabbd8922 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Tue, 2 Apr 2019 16:49:40 -0400 Subject: [PATCH] Change the artifact to also capture the actual envvars data --- awx/main/isolated/manager.py | 10 +++++----- awx/main/tasks.py | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/awx/main/isolated/manager.py b/awx/main/isolated/manager.py index 8e9d8ac7a2..779e9bade8 100644 --- a/awx/main/isolated/manager.py +++ b/awx/main/isolated/manager.py @@ -189,12 +189,12 @@ class IsolatedManager(object): extravars=extravars) status, rc = runner_obj.status, runner_obj.rc if self.check_callback is not None: - command_path = self.path_to('artifacts', self.ident, 'command') - # If the command artifact has been synced back, update the model - if os.path.exists(command_path): - with open(command_path, 'r') as f: + config_path = self.path_to('artifacts', self.ident, 'config') + # If the configuration artifact has been synced back, update the model + if os.path.exists(config_path): + with open(config_path, 'r') as f: data = json.load(f) - self.check_callback(data['command'], data['cwd'], self.runner_params['envvars'].copy()) + self.check_callback(data) self.consume_events(dispatcher) last_check = time.time() diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 2f580a894e..8eca563c5f 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1077,14 +1077,14 @@ class BaseTask(object): self.instance = self.update_model(self.instance.pk, job_args=json.dumps(runner_config.command), job_cwd=runner_config.cwd, job_env=job_env) - def check_handler(self, command, cwd, env): + def check_handler(self, config): ''' IsolatedManager callback triggered by the repeated checks of the isolated node ''' self.instance = self.update_model(self.instance.pk, - job_args=command, - job_cwd=cwd, - job_env=build_safe_env(env)) + job_args=json.dumps(config['command']), + job_cwd=config['cwd'], + job_env=config['env']) @with_path_cleanup