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
tkt-48380: Handle a None value case for serials in certs #1845
Conversation
Can one of the admins verify this patch? |
b55d953
to
dd882a5
Compare
This commit handles a case where old certs may not have serial values set in their respective db entries. Ticket: #48380
dd882a5
to
df5116e
Compare
@@ -728,6 +728,10 @@ def __create_internal(self, data): | |||
if not verrors: | |||
new['type'] = CERT_TYPE_EXISTING | |||
|
|||
new.update(self.load_certificate(new['certificate'])) |
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.
load_certificate should be called using middleware.call because it may block.
@@ -845,8 +849,14 @@ def __init__(self, *args, **kwargs): | |||
|
|||
ca_signed_certs.extend((await child_serials(ca_id))) | |||
|
|||
# There is for a case when user might have old certs in the db whose serial value | |||
# isn't set in the db | |||
ca_signed_certs = list(filter(None.__ne__, ca_signed_certs)) |
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.
is __ne__
needed? Doesnt just None remove None from the list?
This commit handles a case where old certs may not have serial values set in their respective db entries.
Ticket: #48380