Skip to content
Snippets Groups Projects
Commit 60bf19b7 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

improve error reporting

parent d385aafb
No related branches found
No related tags found
1 merge request!4L2SS-2098: Fix various issues happening during renewal
Pipeline #104032 passed with warnings
Pipeline: Cryptocoryne

#104033

    ......@@ -2,6 +2,8 @@
    # SPDX-License-Identifier: Apache-2.0
    """ Cryptocoryne certbot cli entrypoint """
    import time
    import acme.errors
    import hvac
    ......@@ -37,15 +39,24 @@ def main():
    print("Waiting for DNS to propagate...")
    if client.check_dns_propagation(timeout=1200):
    print("Succeed. Request certificate")
    for _ in range(3):
    try:
    client.request_certificate()
    except acme.errors.ValidationError as ve:
    print(f"ValidationError: {ve.failed_authzrs}")
    else:
    break
    print("Request failed. Retry in", end=" ")
    for t in range(5):
    time.sleep(1)
    print(t, end=" ")
    print("...")
    certificate.fullchain = client.certificate
    vault_store.put_certificate(certificate)
    print("Done")
    else:
    print("Failed to issue certificate for " + str(client.domains))
    except acme.errors.ValidationError as ve:
    print(f"ValidatinError: {ve.failed_authzrs}")
    except Exception as e: # pylint: disable=broad-exception-caught
    print(f"{type(e)}: {e}")
    finally:
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment