| |
@@ -242,9 +242,9 @@
|
| |
admins = []
|
| |
admin_template = []
|
| |
for admin in config['sync2jira']['admins']:
|
| |
- ret = client.search_users(admin.keys()[0])
|
| |
+ ret = client.search_users(list(admin.keys())[0])
|
| |
if len(ret) > 1:
|
| |
- log.warning(' Found multiple users for admin %s' % admin.keys()[0])
|
| |
+ log.warning(' Found multiple users for admin %s' % list(admin.keys())[0])
|
| |
found = False
|
| |
for person in ret:
|
| |
if person.key == issue.downstream.get('owner'):
|
| |
@@ -252,9 +252,9 @@
|
| |
found = True
|
| |
break
|
| |
if not found:
|
| |
- log.warning(' Could not find JIRA user for admin %s' % admin.keys()[0])
|
| |
+ log.warning(' Could not find JIRA user for admin %s' % list(admin.keys())[0])
|
| |
if not ret:
|
| |
- message = ' No admin could be found for username %s' % admin.keys()[0]
|
| |
+ message = ' No admin could be found for username %s' % list(admin.keys())[0]
|
| |
log.warning(message.strip())
|
| |
raise ValueError(message)
|
| |
admins.append(ret[0].emailAddress)
|
| |
@@ -497,6 +497,7 @@
|
| |
return
|
| |
log.warning('Was not able to assign user %s' % issue.assignee[0]['fullname'])
|
| |
|
| |
+
|
| |
def _change_status(client, downstream, status, issue):
|
| |
"""
|
| |
Change status of JIRA issue.
|
| |
@@ -522,6 +523,7 @@
|
| |
else:
|
| |
log.warning(' Could not update JIRA %s for %s' % (status, issue.title))
|
| |
|
| |
+
|
| |
def _create_jira_issue(client, issue, config):
|
| |
"""
|
| |
Create a JIRA issue and adds all relevant
|
| |
@@ -587,7 +589,7 @@
|
| |
_attach_link(client, downstream, remote_link)
|
| |
|
| |
default_status = issue.downstream.get('default_status', None)
|
| |
- if default_status != None:
|
| |
+ if default_status is not None:
|
| |
_change_status(client, downstream, default_status, issue)
|
| |
|
| |
# Update relevant information (i.e. tags, assignees etc.) if the
|
| |
@@ -725,6 +727,7 @@
|
| |
# Find all possible transactions (i.e. change states) we could `do
|
| |
_change_status(client, existing, closed_status, issue)
|
| |
|
| |
+
|
| |
def _update_title(issue, existing):
|
| |
"""
|
| |
Helper function to sync upstream/downstream title.
|
| |
Added some type assertion and modified values to work with the tox commands in place.