Don't fail more if cert req/cert creation failed

This should help debugging issues that could happen during server
certificate creation.

https://pagure.io/freeipa/issue/6755

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Stanislav Laznicka authored and Martin Basti committed 2017-03-14 15:02:42 +01:00
1 parent 992e6ecd1f
commit 8980f4098e
1 file changed
+5 -2
+5 -2
View File
@@ -368,8 +368,11 @@ class CertDB(object):
with open(self.certder_fname, "r") as f:
dercert = f.read()
finally:
os.unlink(self.certreq_fname)
os.unlink(self.certder_fname)
for fname in (self.certreq_fname, self.certder_fname):
try:
os.unlink(fname)
except OSError:
pass
return dercert