[master/rhel7] Update makebumpver to include flags on first request

Brian C. Lane bcl at redhat.com
Fri Aug 15 18:50:20 UTC 2014


python-bugzilla has been complaining that it needs to refresh the object
because it didn't get the flags the first time. This switches to using
.getbug instead of .query and adds the flags to the returned data for
each bug.
---
 scripts/makebumpver | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/makebumpver b/scripts/makebumpver
index ce24018..cce8f08 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -130,7 +130,7 @@ class MakeBumpVer:
 
         return ret
 
-    def _queryBug(self, bug):
+    def _queryBug(self, bugid):
         if not self.bz:
             sys.stdout.write("Connecting to %s...\n" % self.bzserver)
 
@@ -150,17 +150,17 @@ class MakeBumpVer:
             rc = self.bz.login(self.username, self.password)
             log.debug("login rc = %s", rc)
 
-        if bug in self._bz_cache:
-            return self._bz_cache[bug]
+        if bugid in self._bz_cache:
+            return self._bz_cache[bugid]
 
-        bugs = self.bz.query({'bug_id': bug})
-        log.debug("bugs = %s", bugs)
+        bug = self.bz.getbug(bugid, extra_fields="flags")
+        log.debug("bug = %s", bug)
 
-        if len(bugs) != 1:
+        if not bug:
             return None
         else:
-            self._bz_cache[bug] = bugs[0]
-            return bugs[0]
+            self._bz_cache[bugid] = bug
+            return bug
 
     def _isRHELBug(self, bug, commit, summary):
         bzentry = self._queryBug(bug)
-- 
1.9.3



More information about the anaconda-patches mailing list