diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-07-22 22:49:38 +0200 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2022-07-22 14:28:11 -0700 |
| commit | 1ef70188da1e29cd8ba95bf58c994ba7dd3010c5 (patch) | |
| tree | 01bdb9a352cfdd2bf9c25347678962a689f6c6e5 /gitlab | |
| parent | ac46c1cb291c03ad14bc76f5f16c9f98f2a5a82d (diff) | |
| download | gitlab-1ef70188da1e29cd8ba95bf58c994ba7dd3010c5.tar.gz | |
fix(config): raise error when gitlab id provided but no config section found
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/config.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gitlab/config.py b/gitlab/config.py index 2fe058a..dc577fc 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -137,6 +137,12 @@ class GitlabConfigParser: _config = configparser.ConfigParser() _config.read(self._files) + if self.gitlab_id and not _config.has_section(self.gitlab_id): + raise GitlabDataError( + f"A gitlab id was provided ({self.gitlab_id}) " + "but no config section found" + ) + if self.gitlab_id is None: try: self.gitlab_id = _config.get("global", "default") |
