Enable utilized EE Collections name and version info to be detected

This commit is contained in:
beeankha
2021-02-16 17:40:53 -05:00
committed by Shane McDonald
parent b417fc3803
commit 86a3a79be4
3 changed files with 33 additions and 2 deletions

View File

@@ -1179,11 +1179,17 @@ class BaseTask(object):
instance.log_lifecycle("finalize_run")
job_profiling_dir = os.path.join(private_data_dir, 'artifacts/playbook_profiling')
awx_profiling_dir = '/var/log/tower/playbook_profiling/'
collections_info = os.path.join(private_data_dir, 'artifacts/')
if not os.path.exists(awx_profiling_dir):
os.mkdir(awx_profiling_dir)
if os.path.isdir(job_profiling_dir):
shutil.copytree(job_profiling_dir, os.path.join(awx_profiling_dir, str(instance.pk)))
if os.path.exists(collections_info):
with open(collections_info + 'collections.json') as ee_json_info:
ee_collections_info = ee_json_info.read()
instance.installed_collections = ee_collections_info
instance.save(update_fields=['installed_collections'])
def event_handler(self, event_data):
#