From f0bcfc6024a0d6a05c7fee3bdd61f76e54d56739 Mon Sep 17 00:00:00 2001 From: Elijah DeLee Date: Fri, 11 Jun 2021 14:06:27 -0400 Subject: [PATCH] add EE information to assert_status This should help debugging to know what the EE was when an unexpected status was found. --- awxkit/awxkit/api/mixins/has_status.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/awxkit/awxkit/api/mixins/has_status.py b/awxkit/awxkit/api/mixins/has_status.py index e4bd603327..057b349672 100644 --- a/awxkit/awxkit/api/mixins/has_status.py +++ b/awxkit/awxkit/api/mixins/has_status.py @@ -67,6 +67,14 @@ class HasStatus(object): msg += '{0}-{1} has status of {2}, which is not in {3}.'.format(self.type.title(), self.id, self.status, status_list) if getattr(self, 'job_explanation', ''): msg += '\njob_explanation: {}'.format(bytes_to_str(self.job_explanation)) + if getattr(self, 'execution_environment', ''): + msg += '\nexecution_environment: {}'.format(bytes_to_str(self.execution_environment)) + if getattr(self, 'related', False): + ee = self.related.execution_environment.get() + msg += f'\nee_image: {ee.image}' + msg += f'\nee_credential: {ee.credential}' + msg += f'\nee_pull_option: {ee.pull}' + msg += f'\nee_summary_fields: {ee.summary_fields}' if getattr(self, 'result_traceback', ''): msg += '\nresult_traceback:\n{}'.format(bytes_to_str(self.result_traceback))