aac7179 Improve performance of ipa-server-guard

1 file Authored by rcritten 3 years ago, Committed by abbra 3 years ago,
    Improve performance of ipa-server-guard
    
    * Drop support for python 2
    * Only import traceback and syslog when needed
    * Only import ipaserver.install.certs when the lock is needed
    * Only import ipautil when run is needed
    
    For the unsupported operations case this improves performance by
    95%
    
    For the supported operations that don't require a lock the
    improvement is about 50%.
    
    For the supported operations that require a lock the improvement
    is about 20%
    
    When configuring a CA certmonger calls its helper with the
    following operations:
    
    IDENTIFY
    FETCH-ROOTS
    GET-SUPPORTED-TEMPLATES
    GET-DEFAULT-TEMPLATE
    GET-NEW-REQUEST-REQUIREMENTS
    GET-RENEW-REQUEST-REQUIREMENTS
    FETCH-SCEP-CA-CAPS
    FETCH-SCEP-CA-CERTS
    
    Only IDENTIFY, FETCH-ROOTS and GET-NEW-REQUEST-REQUIREMENTS are
    supported by ipa-submit, along with the request options SUBMIT and
    POLL.
    
    Which means every time the IPA CA in certmonger is updated
    eight calls to ipa-server-guard are made so the savings are
    cumulative.
    
    The savings when executing these eight operations is a 73% decrease
    (.7 sec vs 2.5 sec).
    
    https://pagure.io/freeipa/issue/8425
    
    Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
    Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>