summaryrefslogtreecommitdiff
path: root/buildscripts/jiraclient.py
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-03-26 11:25:04 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-03-26 13:04:25 -0400
commit36148ad8bbdb94162b2926f4700d935ee4dc5994 (patch)
tree1d893c4ca0b0afa407f7724c7942dfbf643560af /buildscripts/jiraclient.py
parentd62d631f0ca40c5199fdfae2980080ca0cc982b5 (diff)
downloadmongo-36148ad8bbdb94162b2926f4700d935ee4dc5994.tar.gz
SERVER-23312 Format Python files with yapf
Diffstat (limited to 'buildscripts/jiraclient.py')
-rw-r--r--buildscripts/jiraclient.py27
1 files changed, 9 insertions, 18 deletions
diff --git a/buildscripts/jiraclient.py b/buildscripts/jiraclient.py
index a6896a6186d..7d798a9a4b5 100644
--- a/buildscripts/jiraclient.py
+++ b/buildscripts/jiraclient.py
@@ -12,24 +12,16 @@ class JiraClient(object):
FIXED_RESOLUTION_NAME = "Fixed"
WONT_FIX_RESOLUTION_NAME = "Won't Fix"
- def __init__(self,
- server,
- username=None,
- password=None,
- access_token=None,
- access_token_secret=None,
- consumer_key=None,
- key_cert=None):
+ def __init__(self, server, username=None, password=None, access_token=None,
+ access_token_secret=None, consumer_key=None, key_cert=None):
"""Initialize the JiraClient with the server URL and user credentials."""
opts = {"server": server, "verify": True}
basic_auth = None
oauth_dict = None
if access_token and access_token_secret and consumer_key and key_cert:
oauth_dict = {
- "access_token": access_token,
- "access_token_secret": access_token_secret,
- "consumer_key": consumer_key,
- "key_cert": key_cert
+ "access_token": access_token, "access_token_secret": access_token_secret,
+ "consumer_key": consumer_key, "key_cert": key_cert
}
elif username and password:
basic_auth = (username, password)
@@ -37,18 +29,17 @@ class JiraClient(object):
raise TypeError("Must specify Basic Auth (using arguments username & password)"
" or OAuth (using arguments access_token, access_token_secret,"
" consumer_key & key_cert_file) credentials")
- self._jira = jira.JIRA(
- options=opts, basic_auth=basic_auth, oauth=oauth_dict, validate=True)
+ self._jira = jira.JIRA(options=opts, basic_auth=basic_auth, oauth=oauth_dict, validate=True)
self._transitions = {}
self._resolutions = {}
def create_issue(self, project, summary, description, labels=None):
"""Create an issue."""
- fields = {"project": project,
- "issuetype": {"name": "Task"},
- "summary": summary,
- "description": description}
+ fields = {
+ "project": project, "issuetype": {"name": "Task"}, "summary": summary,
+ "description": description
+ }
new_issue = self._jira.create_issue(fields=fields)
if labels:
new_issue.update(fields={"labels": labels})