add EE information to assert_status

This should help debugging to know what the EE was when an unexpected
status was found.
This commit is contained in:
Elijah DeLee 2021-06-11 14:06:27 -04:00 committed by Shane McDonald
parent d946103961
commit f0bcfc6024
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374

View File

@ -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))