Skip to content

Commit

Permalink
Clean up code, run postgresql importer locally aboutcode-org#969
Browse files Browse the repository at this point in the history
Reference: aboutcode-org#969

Signed-off-by: John M. Horan <[email protected]>
  • Loading branch information
johnmhoran authored and TG1999 committed Nov 21, 2022
1 parent 79f6f71 commit cfa0180
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions vulnerabilities/importers/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def advisory_data(self):
if known_urls == visited_urls:
break

# JMH: why did we replace "for url in visited_urls:"?
for url, data in data_by_url.items():
yield from to_advisories(data)

Expand Down Expand Up @@ -96,11 +95,6 @@ def to_advisories(data):
)
cve_id = ""
try:
# in the prior code, this is the only place where cve_id was defined, and presumably
# there was no error like the error we got:
# UnboundLocalError: local variable 'cve_id' referenced before assignment

# changed from nobr to .nobr due to html changes
cve_id = ref_col.select(".nobr")[0].text
# This is for the anomaly in https://www.postgresql.org/support/security/8.1/ 's
# last entry
Expand Down Expand Up @@ -130,16 +124,12 @@ def to_advisories(data):
if cve_id:
advisories.append(
AdvisoryData(
# we defined cve_id and added the if... because we got this error:
# UnboundLocalError: local variable 'cve_id' referenced before assignment
# but JMH is not sure what caused the error or whether this is a legit fix
aliases=[cve_id],
summary=summary,
references=references,
affected_packages=affected_packages,
)
)

return advisories


Expand Down

0 comments on commit cfa0180

Please sign in to comment.