From 215ff622bb6806a11cb67bb54a6628f6760eddb8 Mon Sep 17 00:00:00 2001 From: krateng Date: Tue, 7 Nov 2023 18:50:33 +0100 Subject: [PATCH] Feedback for directory permission problems, GH-283 --- maloja/pkg_global/conf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/maloja/pkg_global/conf.py b/maloja/pkg_global/conf.py index 129ab8a..cf59f8e 100644 --- a/maloja/pkg_global/conf.py +++ b/maloja/pkg_global/conf.py @@ -281,6 +281,17 @@ else: "logs":pthj(malojaconfig['DATA_DIRECTORY'],"logs"), } +# check if the directories are usable in case we explicitly specified them +# this is of course redundant if we found them ourselves above, but it's easier +# to do this now with the already built full paths +for cat in dir_settings: + if is_dir_usable(dir_settings[cat]): + pass + else: + print("Directory",dir_settings[cat],"is not usable.") + print("Please change permissions or settings!") + raise PermissionError + data_directories = { "auth":pthj(dir_settings['state'],"auth"),