def revoke()

in lemur/certificates/cli.py [0:0]


def revoke(path, cert_id, reason, message, commit):
    """
    Revokes given certificate.
    """
    if not path and not cert_id:
        print("[!] No input certificates mentioned to revoke")
        return
    if path and cert_id:
        print("[!] Please mention single certificate id (-id) or input file (-p)")
        return

    if commit:
        print("[!] Running in COMMIT mode.")

    print("[+] Starting certificate revocation.")

    if reason not in CRLReason.__members__:
        reason = CRLReason.unspecified.name
    comments = {"comments": message, "crl_reason": reason}

    if cert_id:
        worker(cert_id, commit, comments)
    else:
        with open(path, "r") as f:
            for x in f.readlines()[2:]:
                worker(x, commit, comments)