-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix importer crash #1541 #1542
Fix importer crash #1541 #1542
Conversation
Reference: #1541 Signed-off-by: Philippe Ombredanne <[email protected]>
Use the latest date file from nginx Reference: #1541 Signed-off-by: Philippe Ombredanne <[email protected]>
Otherwise the VulnerabilitySeverity.published_at data will be an invalid "None" string. Reference: #1541 Signed-off-by: Philippe Ombredanne <[email protected]>
3b5e5f6
to
be28af3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I apologize for introducing this bug.
except Exception as e: | ||
logger.info(f"Failed to process advisory: {advisory!r} with error {e!r}") | ||
except Exception: | ||
from pprint import pformat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pombredanne Would it be better to move the pprint
library import to the top of the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR is correction for the crash in #1541
The issue was introduced by this commit 0fe73ef#diff-11856d929972b1aa71dcd476298a831d6b598b291c0638057af6d62050ba4a15R192
We now check for empty published_at before using it. Otherwise the VulnerabilitySeverity.published_at data will be an invalid "None" string resulting from
str(None)
.Also improve logging.