1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-01-23 12:37:05 +00:00

Fixed SIM101 (duplicate-isinstance-call): Multiple isinstance calls for pem, merge into a single call

This commit is contained in:
Teal Dulcet 2025-01-08 05:13:00 -08:00
parent f53679d561
commit 3646227873

View File

@ -63,9 +63,7 @@ def get_ssl_certificates(env):
if isinstance(pem, Certificate):
certificates.append({ "filename": fn, "cert": pem })
# It is a private key
elif (isinstance(pem, rsa.RSAPrivateKey)
or isinstance(pem, dsa.DSAPrivateKey)
or isinstance(pem, ec.EllipticCurvePrivateKey)):
elif (isinstance(pem, (rsa.RSAPrivateKey, dsa.DSAPrivateKey, ec.EllipticCurvePrivateKey))):
private_keys[pem.public_key().public_numbers()] = { "filename": fn, "key": pem }