summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2008-10-13 17:16:02 -0400
committerWill Woods <wwoods@redhat.com>2008-10-13 17:16:02 -0400
commit48a4d90f39bf7347c82f868f4c93cc241b384e33 (patch)
tree32c0d3cc22ff6470136dc1d17e7e7655cce97b61 /bin
parent1224a5fadd9d16c9a74e3c3837a6d6315008d343 (diff)
downloadpython-bugzilla-48a4d90f39bf7347c82f868f4c93cc241b384e33.zip
python-bugzilla-48a4d90f39bf7347c82f868f4c93cc241b384e33.tar.gz
python-bugzilla-48a4d90f39bf7347c82f868f4c93cc241b384e33.tar.xz
clean up dzickus' --oneline patch
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bugzilla35
1 files changed, 18 insertions, 17 deletions
diff --git a/bin/bugzilla b/bin/bugzilla
index 515a30b..66d3889 100755
--- a/bin/bugzilla
+++ b/bin/bugzilla
@@ -170,8 +170,8 @@ def setup_action_parser(action):
const='ids',help="output only bug IDs")
p.add_option('-e','--extra',action='store_const',dest='output',
const='extra',help="output additional bug information (keywords, Whiteboards, etc.)")
- p.add_option('--oneline', action='store_const', dest='output',
- const='oneline',help="one line summary of the bug (useful for scripts)")
+ p.add_option('--oneline', action='store_const', dest='output',
+ const='oneline',help="one line summary of the bug (useful for scripts)")
p.add_option('--outputformat',
help="Print output in the form given. You can use RPM-style "+
"tags that match bug fields, e.g.: '%{bug_id}: %{short_desc}'")
@@ -486,22 +486,23 @@ def main():
if b.status_whiteboard: print " +Status Whiteboard: ",b.status_whiteboard
if b.devel_whiteboard: print " +Devel Whiteboard: ",b.devel_whiteboard
print "\nBugs listed: ",len(buglist)
- elif opt.output == 'oneline':
- for b in fullbuglist:
- flags=''
- cve=''
- #grab all the flags that are set
- for i in b.flag_types:
- for s in i['flags']:
- if s['status']: flags += i['name'] + ":" + str(s['status']) + " "
- #grab CVEs by searching the keywords and grabbing that bugzilla
+ elif opt.output == 'oneline':
+ fullbuglist = bz.getbugs([b.bug_id for b in buglist])
+ for b in fullbuglist:
+ flags=''
+ cve=''
+ #grab all the flags that are set
+ for i in b.flag_types:
+ for s in i['flags']:
+ if s['status']: flags += i['name'] + ":" + str(s['status']) + " "
+ #grab CVEs by searching the keywords and grabbing that bugzilla
if b.keywords.find("Security") != -1:
- for bl in b.blocked:
- cvebug = bz.getbug(bl)
- if cvebug.alias.find("CVE") != -1:
- cve += cvebug.alias + " "
- print "#%s %8s %22s %s\t[%s] %s %s" % (b.bug_id, b.bug_status,
- b.assigned_to, b.component, b.target_milestone, flags, cve)
+ for bl in b.blocked:
+ cvebug = bz.getbug(bl)
+ if cvebug.alias.find("CVE") != -1:
+ cve += cvebug.alias + " "
+ print "#%s %8s %22s %s\t[%s] %s %s" % (b.bug_id, b.bug_status,
+ b.assigned_to, b.component, b.target_milestone, flags, cve)
else:
parser.error("opt.output was set to something weird.")