Fix incorrect 'with' statement in CA-less installation

Part of: https://pagure.io/freeipa/issue/7118

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
Fraser Tweedale 2017-08-24 14:04:59 +10:00 committed by Pavel Vomacka
parent 6ca8787cc7
commit 477b3dca80

View File

@ -579,8 +579,8 @@ class NSSDatabase(object):
self.add_cert(cert, nickname, EMPTY_TRUST_FLAGS)
if extracted_key:
with tempfile.NamedTemporaryFile(), tempfile.NamedTemporaryFile() \
as (in_file, out_file):
with tempfile.NamedTemporaryFile() as in_file, \
tempfile.NamedTemporaryFile() as out_file:
x509.write_certificate_list(extracted_certs, in_file.name)
in_file.write(extracted_key)
in_file.flush()