Skip to content

Commit

Permalink
Continue despite failure in downloading cpedict
Browse files Browse the repository at this point in the history
Signed-off-by: Henri Rosten <[email protected]>
  • Loading branch information
henrirosten committed Dec 22, 2023
1 parent 6804d79 commit e02af45
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sbomnix/cpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ def __init__(self):
LOG.debug("read CPE dictionary from cache")
else:
LOG.debug("CPE cache miss, downloading: %s", _CPE_CSV_URL)
self.df_cpedict = df_from_csv_file(_CPE_CSV_URL)
self.cache.set(_CPE_CSV_URL, self.df_cpedict, ttl=_CPE_CSV_CACHE_TTL)
self.df_cpedict = df_from_csv_file(_CPE_CSV_URL, exit_on_error=False)
if self.df_cpedict is None or self.df_cpedict.empty:
LOG.warning(
"Failed downloading cpedict: CPE information might not be accurate"
)
else:
self.cache.set(_CPE_CSV_URL, self.df_cpedict, ttl=_CPE_CSV_CACHE_TTL)
if self.df_cpedict is not None:
# Verify the loaded cpedict contains at least the following columns
required_cols = {"vendor", "product"}
Expand Down

0 comments on commit e02af45

Please sign in to comment.