Skip to content

Commit

Permalink
Fix GitLab plugin's ssl_verify option [fix #168]
Browse files Browse the repository at this point in the history
  • Loading branch information
psss committed Dec 20, 2018
1 parent 4bcc705 commit e31c448
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion did/plugins/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from did.utils import log, pretty, listed
from did.base import Config, ReportError
from did.stats import Stats, StatsGroup
from requests.packages.urllib3.exceptions import InsecureRequestWarning

GITLAB_SSL_VERIFY = True
GITLAB_API = 4
Expand Down Expand Up @@ -309,9 +310,12 @@ def __init__(self, option, name=None, parent=None, user=None):
"No GitLab token set in the [{0}] section".format(option))
# Check SSL verification
try:
self.ssl_verify = distutils.util.strtobool(config["ssl_verify"])
self.ssl_verify = bool(distutils.util.strtobool(
config["ssl_verify"]))
except KeyError:
self.ssl_verify = GITLAB_SSL_VERIFY
if not self.ssl_verify:
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
self.gitlab = GitLab(self.url, self.token, self.ssl_verify)
# Create the list of stats
self.stats = [
Expand Down

0 comments on commit e31c448

Please sign in to comment.