Get jenkins config only with the key exists 51/15851/5
authorAnil Belur <abelur@linuxfoundation.org>
Tue, 11 Jun 2019 02:53:10 +0000 (12:53 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Tue, 11 Jun 2019 02:53:11 +0000 (12:53 +1000)
commit9d64c0644c4df403243eb89014d6257827d9d281
treedec6f1058dd35cece6456aab2de60dbefcbc64a6
parentdfd4d058ca1f9eca88259b6ebf2ea85716129223
Get jenkins config only with the key exists

Handle config parser correctly which defaults to "[jenkins]" section
when no server is pased. This fixes the issue with checking if the key
exists in the configuration read before reading the key-value.

The issue is reproduceable by running `lftools jenkins plugins --help`
or `tox -e docs`, with the ``jenkins.ini`` file having no "[jenkins]"
section.

Use SafeConfigParser which is a saner version for parsing config files.

Issue: RELENG-2120
Change-Id: I274ac46cf7a1d03cf7c3c6fdaec6094b5e02aa42
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
lftools/jenkins/__init__.py
releasenotes/notes/fix-jenkins-config-parser-d9eb6e7068a7906a.yaml [new file with mode: 0644]