summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBjoern Tropf <asym@gentoo.org>2009-11-14 13:19:00 +0100
committerBjoern Tropf <asym@gentoo.org>2009-11-14 13:19:00 +0100
commit9c20371276a8668ad07c4dfadc49b3f5c525d9fb (patch)
tree713bd39befcdc3693b09b53ae799f0a8960d07d4 /tools
parentFix small bug (diff)
downloadkernel-check-9c20371276a8668ad07c4dfadc49b3f5c525d9fb.tar.gz
kernel-check-9c20371276a8668ad07c4dfadc49b3f5c525d9fb.tar.bz2
kernel-check-9c20371276a8668ad07c4dfadc49b3f5c525d9fb.zip
Fix various bugs
Diffstat (limited to 'tools')
-rwxr-xr-xtools/cron.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/cron.py b/tools/cron.py
index ddf1792..f5d7f91 100755
--- a/tools/cron.py
+++ b/tools/cron.py
@@ -58,8 +58,8 @@ REGEX = {
'bugzilla' : re.compile(r'(?<=bug.cgi\?id=)\d*'),
'grp_all' : re.compile(r'(?<=\()[ (]*CVE-(\d{4})' \
r'([-,(){}|, \d]+)(?=\))'),
- 'm_nomatch' : re.compile(r'.*GENERIC-MAP-NOMATCH.*'),
'grp_split' : re.compile(r'(?<=\D)(\d{4})(?=\D|$)'),
+ 'm_nomatch' : re.compile(r'.*GENERIC-MAP-NOMATCH.*'),
'wb_match' : re.compile(r'\s*\[\s*([^ +<=>]+)\s*([' \
r'<=>]{1,2})\s*([^ <=>\]]+' \
r')\s*(?:([<=>]{1,2})\s*([' \
@@ -164,6 +164,7 @@ def receive_file(directory, url, xml_file):
except IOError:
logging.error('File %s - Download failed!' % filename)
+ return
logging.debug('File %s - %sKB received' %
(filename, os.path.getsize(filename)/1024))
@@ -232,7 +233,7 @@ def parse_bz_dict(directory, bugid):
try:
string = root.find('short_desc').text
except AttributeError:
- CronError('No Cve')
+ raise CronError('No Cve')
try:
cvelist = list()
@@ -245,6 +246,9 @@ def parse_bz_dict(directory, bugid):
for cve in REGEX['grp_split'].findall(split_cves):
cvelist.append('CVE-%s-%s' % (year, cve))
+ if not cvelist:
+ raise CronError('No Cve')
+
vul = {
'bugid' : bugid,
'cvelist' : cvelist,