From db2a2cfa115bd0c5c7758376f007963dda757379 Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Fri, 6 Dec 2019 11:36:12 -0600 Subject: [PATCH] Added ensure_keys function --- copy_local_keys.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/copy_local_keys.py b/copy_local_keys.py index 42ebb48..84f3405 100644 --- a/copy_local_keys.py +++ b/copy_local_keys.py @@ -1,4 +1,5 @@ import os +from functools import partial def mod_time(path): @@ -19,3 +20,7 @@ def find_newest_cert(root_dir, hostname): elif mod_time(fullpath) > mod_time(look_for[file]): look_for[file] = fullpath return look_for + + +def ensure_keys(key_dir, hostname): + files = (part.format(hostname) for part in ("{}.key.pem", "{}.chain.pem"))