From 0770254ce347c9892f6b143bb5f48fb1b0826e2a Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 4 Sep 2019 13:31:58 -0400 Subject: [PATCH] Defer initializing the API in dogtag-ipa-ca-renew-agent-submit Wait until we know a supported operation is being called (SUBMIT and POLL) before initializing the API, which can be an expensive operation. https://bugzilla.redhat.com/show_bug.cgi?id=1656519 Reviewed-By: Fraser Tweedale --- install/certmonger/dogtag-ipa-ca-renew-agent-submit.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/certmonger/dogtag-ipa-ca-renew-agent-submit.in b/install/certmonger/dogtag-ipa-ca-renew-agent-submit.in index 19e50da4d..a9f17db3a 100644 --- a/install/certmonger/dogtag-ipa-ca-renew-agent-submit.in +++ b/install/certmonger/dogtag-ipa-ca-renew-agent-submit.in @@ -473,13 +473,13 @@ def main(): else: kwargs['reuse_existing'] = True - api.bootstrap(in_server=True, context='renew', confdir=paths.ETC_IPA) - api.finalize() - operation = os.environ.get('CERTMONGER_OPERATION') if operation not in ('SUBMIT', 'POLL'): return OPERATION_NOT_SUPPORTED_BY_HELPER + api.bootstrap(in_server=True, context='renew', confdir=paths.ETC_IPA) + api.finalize() + tmpdir = tempfile.mkdtemp(prefix="tmp-") certs.renewal_lock.acquire() try: