summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/cli.rst4
-rw-r--r--gitlab/config.py4
2 files changed, 7 insertions, 1 deletions
diff --git a/docs/cli.rst b/docs/cli.rst
index f75a46a..7620349 100644
--- a/docs/cli.rst
+++ b/docs/cli.rst
@@ -37,7 +37,6 @@ example:
default = somewhere
ssl_verify = true
timeout = 5
- api_version = 3
[somewhere]
url = https://some.whe.re
@@ -69,6 +68,9 @@ parameters. You can override the values in each GitLab server section.
* - ``timeout``
- Integer
- Number of seconds to wait for an answer before failing.
+ * - ``api_version``
+ - ``3`` ou ``4``
+ - The API version to use to make queries. Requires python-gitlab >= 1.3.0.
You must define the ``url`` in each GitLab server section.
diff --git a/gitlab/config.py b/gitlab/config.py
index 9cf208c..3166ec4 100644
--- a/gitlab/config.py
+++ b/gitlab/config.py
@@ -130,6 +130,10 @@ class GitlabConfigParser(object):
self.api_version = '3'
try:
+ self.api_version = self._config.get('global', 'api_version')
+ except Exception:
+ pass
+ try:
self.api_version = self._config.get(self.gitlab_id, 'api_version')
except Exception:
pass