From dd637165ea4b1c9a6069d51db4038907f40a79ff Mon Sep 17 00:00:00 2001 From: Milan Bharanya <10432831+mbharanya@users.noreply.github.com> Date: Sat, 20 Aug 2022 12:15:22 +0200 Subject: [PATCH] Hoist config variable to top scope It seems that in recent changes the config was moved into the main function, but not passed to all necessary other functions as an argument. To fix it for my case I simply put the config in the global scope. --- slack-matrix-migration/slack-matrix-migration/migrate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slack-matrix-migration/slack-matrix-migration/migrate.py b/slack-matrix-migration/slack-matrix-migration/migrate.py index 963baea..bf7694c 100644 --- a/slack-matrix-migration/slack-matrix-migration/migrate.py +++ b/slack-matrix-migration/slack-matrix-migration/migrate.py @@ -107,6 +107,8 @@ def test_config(yaml): return config +config = test_config(config_yaml) + def loadZip(config): zipName = config["zipfile"] log.info("Opening zipfile: " + zipName) @@ -866,8 +868,6 @@ def main(): logging.captureWarnings(True) log = logging.getLogger('SLACK.MIGRATE.MAIN') - config = test_config(yaml) - jsonFiles = loadZip(config) # login with admin user to gain access token