summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2015-09-21 20:03:45 +0200
committerTill Maas <opensource@till.name>2015-09-21 20:03:45 +0200
commite7091fa8a9f0a5ba81a4b360446011aa0ce5f28d (patch)
tree48f4c120a63e9c23d00a0ea14cfc84a649f9a47c
parent2fe169d4c1a9e97efa84ed8d3999e55cba4df294 (diff)
downloadfedora-easy-karma-e7091fa8a9f0a5ba81a4b360446011aa0ce5f28d.tar.gz
fedora-easy-karma-e7091fa8a9f0a5ba81a4b360446011aa0ce5f28d.tar.xz
fedora-easy-karma-e7091fa8a9f0a5ba81a4b360446011aa0ce5f28d.zip
Cleanup/improve Bodhi2 adjustments
-rwxr-xr-xfedora-easy-karma.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/fedora-easy-karma.py b/fedora-easy-karma.py
index 9e77244..9f760b8 100755
--- a/fedora-easy-karma.py
+++ b/fedora-easy-karma.py
@@ -182,13 +182,12 @@ class FEK_helper(object):
else:
values["comments"] = ""
- # does this need to be changed to alias?
- if update["updateid"]:
- url_path = "updates/%s" % (update["updateid"])
+ if update["alias"]:
+ url_path = update["alias"]
else:
url_path = update["title"]
- values["update_url"] = " %s%s\n" % (bodhi_base_url, url_path)
+ values["update_url"] = " %supdates/%s\n" % (bodhi_base_url, url_path)
# stable_karma can come back as None, meaning that auto-requesting push
# to stable has been disabled.
# https://github.com/fedora-infra/bodhi/issues/274
@@ -575,11 +574,13 @@ class FedoraEasyKarma(object):
# since bodhi now has a limit of 100 but multiple pages, get ALL
# of the updates before starting to process
result = bodhi_client.query(**query_args)
+ self.debug("Queried Bodhi page 1", False)
updates.extend(result['updates'])
while result.page < result.pages:
next_page = result['page'] + 1
self.info("Fetching updates page {} of {}".format(next_page, result['pages']))
result = bodhi_client.query(page=next_page, **query_args)
+ self.debug("Queried Bodhi page %s" % next_page, False)
updates.extend(result['updates'])
# There is no clear indication which Exceptions bc.query() might
# throw, therefore catch all (python-fedora-0.3.32.3-1.fc19)
@@ -590,18 +591,9 @@ class FedoraEasyKarma(object):
return updates
-
def already_commented(self, update, user):
for comment in update["comments"]:
- # :TODO:WORKAROUND:
- # .split(" ")[0] is needed to work around bodhi using
- # 'fas_username (group)' in the author field. Hopefully
- # bodhi will eventually not do this anymore.
- # References:
- # https://fedorahosted.org/bodhi/ticket/400
- # https://bugzilla.redhat.com/show_bug.cgi?id=572228
- if not comment["anonymous"] and \
- comment["user"]["name"] == user:
+ if not comment["anonymous"] and comment["user"]["name"] == user:
return True
return False