Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle authentication errors in the Jira plugin
This should also fix BZ#1634529.
  • Loading branch information
psss committed Nov 26, 2018
1 parent 3672775 commit 62e5748
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions did/plugins/jira.py
Expand Up @@ -252,8 +252,14 @@ def session(self):
headers = {
"Content-type": "application/json",
"Accept": "application/json"}
self._session.get(self.auth_url, headers=headers, data=data)
response = self._session.get(
self.auth_url, headers=headers, data=data)
else:
gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=DISABLED)
self._session.get(self.auth_url, auth=gssapi_auth)
response = self._session.get(self.auth_url, auth=gssapi_auth)
try:
response.raise_for_status()
except requests.exceptions.HTTPError as error:
log.error(error)
raise ReportError('Jira authentication failed.')
return self._session

0 comments on commit 62e5748

Please sign in to comment.