mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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 <ftweedal@redhat.com>
This commit is contained 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:
|
||||
|
||||
Reference in New Issue
Block a user