From c54156ca1e6c5b75bae897e9d7be19d3a6e74322 Mon Sep 17 00:00:00 2001 From: Data-Monkey Date: Wed, 17 May 2023 11:39:29 +1000 Subject: [PATCH] get_plugin_config changed to top level folders --- back/pialert.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index 4ee3e6d0..0cc997b1 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -3770,9 +3770,12 @@ def get_plugins_configs(): pluginsList = [] - for root, dirs, files in os.walk(pluginsPath): - for d in dirs: # Loop over directories, not files - pluginsList.append(json.loads(get_file_content(pluginsPath + "/" + d + '/config.json'))) + # only top level directories required. No need for the loop + # for root, dirs, files in os.walk(pluginsPath): + + dirs = next(os.walk(pluginsPath))[1] + for d in dirs: # Loop over directories, not files + pluginsList.append(json.loads(get_file_content(pluginsPath + "/" + d + '/config.json'))) return pluginsList