Modified default config path

This commit is contained in:
Anon 2022-08-15 20:43:54 -07:00
parent 831490e473
commit 706d7c8c4e

View File

@ -116,7 +116,13 @@ def config_parser_has_option(config, profile, option):
def get_default_path(filename): def get_default_path(filename):
paths = (".", os.environ["HOME"], "/root", "/") # Add home path locations
path_home = os.environ["HOME"]
path_config = os.path.join(path_home, ".config")
path_config_cred = os.path.join(path_config, "credentials")
# Return first configuration path in list
paths = (".", path_home, path_config, path_config_cred, "/root", "/")
for path in paths: for path in paths:
full_path = os.path.join(path, filename) full_path = os.path.join(path, filename)
if os.path.isfile(full_path): if os.path.isfile(full_path):