SVN: security/cve_reader.py
megabajt
megabajt at pld-linux.org
Thu Apr 26 22:05:25 CEST 2012
Author: megabajt
Date: Thu Apr 26 22:05:25 2012
New Revision: 12561
Modified:
security/cve_reader.py
Log:
Don't fail when cve.mitre.org website is unavailable
Modified: security/cve_reader.py
==============================================================================
--- security/cve_reader.py (original)
+++ security/cve_reader.py Thu Apr 26 22:05:25 2012
@@ -231,13 +231,16 @@
# get cve description
def getCVEdesc(cveID):
- html = urllib2.urlopen("http://cve.mitre.org/cgi-bin/cvename.cgi?name=%s" % cveID).read()
- html = pq(html)
- line = 0
- for i in html("td"):
- if line == 55:
- return "%s<br/><br/>%s<br/><br/>" % (cveID, i.text)
- line = line + 1
+ try:
+ html = urllib2.urlopen("http://cve.mitre.org/cgi-bin/cvename.cgi?name=%s" % cveID).read()
+ html = pq(html)
+ line = 0
+ for i in html("td"):
+ if line == 55:
+ return "%s<br/><br/>%s<br/><br/>" % (cveID, i.text)
+ line = line + 1
+ except urllib2.URLError, e:
+ return ""
# returns index (tag position) in the node which is a list
More information about the pld-cvs-commit
mailing list