Skip to content

Commit

Permalink
Defer initializing the API in dogtag-ipa-ca-renew-agent-submit
Browse files Browse the repository at this point in the history
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 <ftweedal@redhat.com>
  • Loading branch information
rcritten committed Sep 6, 2019
1 parent d9c2edb commit 5c5f537
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions install/certmonger/dogtag-ipa-ca-renew-agent-submit.in
Expand Up @@ -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:
Expand Down

0 comments on commit 5c5f537

Please sign in to comment.