Author: gilbert-guest Date: 2010-02-17 01:59:11 +0000 (Wed, 17 Feb 2010) New Revision: 14116 Modified: bin/tracker_service.py lib/python/nvd.py Log: support changes in nvd schema for remote and local issues Modified: bin/tracker_service.py ==================================================================--- bin/tracker_service.py 2010-02-17 00:02:03 UTC (rev 14115) +++ bin/tracker_service.py 2010-02-17 01:59:11 UTC (rev 14116) @@ -48,6 +48,8 @@ note = ''Restore lower than medium urgencies'' elif self.params[''show_high_urgency''] and prop == ''show_high_urgency'': note = ''Restore lower than high urgencies'' + elif self.params[''show_remote_only''] and prop == ''show_remote_only'': + note = ''Restore local and unset vulnerabilities'' else: note = ''Hide '' + desc l.append(TR(TD(A(url.updateParamsDict({prop : None}), note)))) @@ -72,8 +74,7 @@ def remoteFiltered(self, remote): """Returns True for only remote flaws if filtered.""" - return remote is not None and self.params[''show_remote_only''] \ - and not remote + return self.params[''show_remote_only''] and not remote class BugFilterNoDSA(BugFilter): def __init__(self, params): @@ -670,7 +671,7 @@ pkg_name = "%s (%s)" % (pkg_name, archive) if remote is None: - remote = '''' + remote = ''unset'' elif remote: remote = ''yes'' else: Modified: lib/python/nvd.py ==================================================================--- lib/python/nvd.py 2010-02-17 00:02:03 UTC (rev 14115) +++ lib/python/nvd.py 2010-02-17 01:59:11 UTC (rev 14116) @@ -28,7 +28,7 @@ def __init__(self): self.result = [] self.start_dispatcher = {} - for x in (''entry'', ''local'', ''range'', ''remote'', ''user_init'', + for x in (''entry'', ''local'', ''network'', ''local_network'', ''user_init'', ''avail'', ''conf'', ''int'', ''sec_prot''): self.start_dispatcher[x] = getattr(self, ''TAG_'' + x) self.path = [] @@ -47,23 +47,20 @@ self.discovered = attrs.get(''discovered'', u'''').encode(''utf-8'') self.cve_desc = "" - self.range_local = self.range_remote = self.range_user_init = None + self.range_local = self.range_remote = self.range_user_init = 0 self.loss_avail = self.loss_conf = self.loss_int \ = self.loss_sec_prot_user = self.loss_sec_prot_admin \ = self.loss_sec_prot_other = 0 - def TAG_range(self, name, attrs): - self.range_local = self.range_remote = self.range_user_init = 0 - def TAG_local(self, name, attrs): self.range_local = 1 - def TAG_remote(self, name, attrs): + def TAG_network(self, name, attrs): self.range_remote = 1 + def TAG_local_network(self, name, attrs): + self.range_remote = 1 def TAG_user_init(self, name, attrs): self.range_user_init = 1 - def TAG_loss_types(self, name, attrs): - self.clear_loss() def TAG_avail(self, name, attrs): self.loss_avail = 1 def TAG_conf(self, name, attrs): @@ -80,11 +77,7 @@ def endElement(self, name): if name == ''entry'': - # FIXME: normalize CAN to CVE. Should go away soon. - name = self.name - if name[0:4] == ''CAN-'': - name = ''CVE-'' + name[4:] - self.result.append((name, + self.result.append((self.name, self.cve_desc, self.discovered, self.published,