Skip to content
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

Merged
merged 2 commits into from Sep 28, 2018
Merged

Conversation

sonicaj
Copy link
Member

@sonicaj sonicaj commented Sep 28, 2018

This commit handles a case where old certs may not have serial values set in their respective db entries.
Ticket: #48380

@pcbsd-commit-bot
Copy link

Can one of the admins verify this patch?

@bugclerk bugclerk changed the title Handle a None value case for serials in certs tkt-48380: Handle a None value case for serials in certs Sep 28, 2018
@ghost ghost assigned sonicaj Sep 28, 2018
@ghost ghost added the review label Sep 28, 2018
@sonicaj sonicaj force-pushed the ticket-48380 branch 2 times, most recently from b55d953 to dd882a5 Compare September 28, 2018 20:03
@sonicaj sonicaj removed the WIP label Sep 28, 2018
This commit handles a case where old certs may not have serial values set in their respective db entries.
Ticket: #48380
@@ -728,6 +728,10 @@ def __create_internal(self, data):
if not verrors:
new['type'] = CERT_TYPE_EXISTING

new.update(self.load_certificate(new['certificate']))
Copy link
Member

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))
Copy link
Member

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?

@sonicaj sonicaj merged commit 39108c2 into master Sep 28, 2018
@ghost ghost removed the review label Sep 28, 2018
@sonicaj sonicaj deleted the ticket-48380 branch September 28, 2018 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants