parse_debbug(): parse and fetch multiple bugs
This commit is contained in:
15
plugins.py
15
plugins.py
@@ -69,19 +69,22 @@ def parse_debbug(**args):
|
||||
if not bugs:
|
||||
return None
|
||||
|
||||
url = 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s' % bugs[0]
|
||||
out = []
|
||||
for b in bugs:
|
||||
logger('plugin', 'detected Debian bug #%s' % b)
|
||||
|
||||
url = 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s' % b
|
||||
status, title = extract_title(url)
|
||||
|
||||
if 0 == status:
|
||||
title = 'Debian Bug: %s: %s' % (title, url)
|
||||
out.append('Debian Bug: %s: %s' % (title, url))
|
||||
elif 3 == status:
|
||||
pass
|
||||
out.append('error for #%s: %s' % (b, title))
|
||||
else:
|
||||
return None
|
||||
logger('plugin', 'parse_debbug(): unknown status %d' % status)
|
||||
|
||||
logger('plugin', 'detected Debian bug')
|
||||
return {
|
||||
'msg': title
|
||||
'msg': out
|
||||
}
|
||||
|
||||
@pluginfunction('cve', 'parse a CVE handle', ptypes_PARSE, ratelimit_class = RATE_NO_SILENCE | RATE_GLOBAL)
|
||||
|
||||
Reference in New Issue
Block a user