From a562d9ae0ce21d37df685802be8a4e9150dfdd56 Mon Sep 17 00:00:00 2001 From: "U-AD001\\U317788" Date: Wed, 1 Aug 2018 17:32:50 -0500 Subject: [PATCH] set_stats fails in callback plugin on isolated node #2123 Signed-off-by: U-AD001\U317788 --- awx/lib/awx_display_callback/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/lib/awx_display_callback/module.py b/awx/lib/awx_display_callback/module.py index e6895d5c89..4f32fed305 100644 --- a/awx/lib/awx_display_callback/module.py +++ b/awx/lib/awx_display_callback/module.py @@ -308,7 +308,8 @@ class BaseCallbackModule(CallbackBase): if custom_artifact_data: # create the directory for custom stats artifacts to live in (if it doesn't exist) custom_artifacts_dir = os.path.join(os.getenv('AWX_PRIVATE_DATA_DIR'), 'artifacts') - os.makedirs(custom_artifacts_dir, mode=stat.S_IXUSR + stat.S_IWUSR + stat.S_IRUSR) + if not os.path.isdir(custom_artifacts_dir): + os.makedirs(custom_artifacts_dir, mode=stat.S_IXUSR + stat.S_IWUSR + stat.S_IRUSR) custom_artifacts_path = os.path.join(custom_artifacts_dir, 'custom') with codecs.open(custom_artifacts_path, 'w', encoding='utf-8') as f: