Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/watchdog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,11 @@ def do_with_lock(function):

def generate_key():
if os.path.isfile(key):
return
if os.path.getsize(key) == 0:
logging.info("Purging empty private key file")
os.remove(key)
else:
return

cmd = (
"openssl genpkey -algorithm RSA -out %s -pkeyopt rsa_keygen_bits:3072" % key
Expand Down