summaryrefslogtreecommitdiff
path: root/gitlab/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/config.py')
-rw-r--r--gitlab/config.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/gitlab/config.py b/gitlab/config.py
index 1b665ed..fa2593b 100644
--- a/gitlab/config.py
+++ b/gitlab/config.py
@@ -18,7 +18,17 @@
import os
import configparser
-_DEFAULT_FILES = ["/etc/python-gitlab.cfg", os.path.expanduser("~/.python-gitlab.cfg")]
+
+def _env_config():
+ if "PYTHON_GITLAB_CFG" in os.environ:
+ return [os.environ["PYTHON_GITLAB_CFG"]]
+ return []
+
+
+_DEFAULT_FILES = _env_config() + [
+ "/etc/python-gitlab.cfg",
+ os.path.expanduser("~/.python-gitlab.cfg"),
+]
class ConfigError(Exception):