Merge pull request 'Fix: ERROR: local variable 'certdir' referenced before assignment' (#43) from continue/AV-98:master into master

Reviewed-on: #43
This commit is contained in:
Solderpunk 2023-12-09 19:06:16 +00:00
commit 4b06b23e2a
1 changed files with 1 additions and 1 deletions

View File

@ -110,10 +110,10 @@ class TofuStore:
self.db_conn.commit()
break
else:
certdir = os.path.join(self.config_dir, "cert_cache")
if _HAS_CRYPTOGRAPHY:
# Load the most frequently seen certificate to see if it has
# expired
certdir = os.path.join(self.config_dir, "cert_cache")
with open(os.path.join(certdir, most_frequent_cert+".crt"), "rb") as fp:
previous_cert = fp.read()
previous_cert = x509.load_der_x509_certificate(previous_cert, _BACKEND)