diff options
author | Max Wittig <max.wittig@siemens.com> | 2021-02-01 15:25:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 15:25:53 +0100 |
commit | 643454c5c5bbfb66d5890232a4f07fb04a753486 (patch) | |
tree | ed8a475890c8eef8d60257b41c37b45b2c58a893 /gitlab/config.py | |
parent | 071d699f7e4bf7eb3aa49b78f9cc9e56a473e281 (diff) | |
parent | a69a214ef7f460cef7a7f44351c4861503f9902e (diff) | |
download | gitlab-643454c5c5bbfb66d5890232a4f07fb04a753486.tar.gz |
Merge pull request #1277 from python-gitlab/feat/override-user-agent
feat(api,cli): make user agent configurable
Diffstat (limited to 'gitlab/config.py')
-rw-r--r-- | gitlab/config.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gitlab/config.py b/gitlab/config.py index c8ba896..4647d61 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -18,6 +18,8 @@ import os import configparser +from gitlab.const import USER_AGENT + def _env_config(): if "PYTHON_GITLAB_CFG" in os.environ: @@ -177,3 +179,13 @@ class GitlabConfigParser(object): self.order_by = self._config.get(self.gitlab_id, "order_by") except Exception: pass + + self.user_agent = USER_AGENT + try: + self.user_agent = self._config.get("global", "user_agent") + except Exception: + pass + try: + self.user_agent = self._config.get(self.gitlab_id, "user_agent") + except Exception: + pass |