From 00bba345f9a6f85addfc0ee7341898e0db6dda62 Mon Sep 17 00:00:00 2001 From: Joachim Lusiardi Date: Sat, 27 Dec 2014 20:53:19 +0100 Subject: [PATCH] preexisting directory does not crash the program --- nginx_proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx_proxy.py b/nginx_proxy.py index 63e2181..bb6bdab 100755 --- a/nginx_proxy.py +++ b/nginx_proxy.py @@ -112,7 +112,8 @@ def handle_event(event): print('HUPing nginx') os.kill(pid, signal.SIGHUP) -os.mkdir(target_path) +if not os.path.exists(target_path): + os.mkdirs(target_path) pid = get_pid()