Commit 888742d5 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Tristan Cavelier

monitor: fix folder exist with apachedex

parent a0b6e6a9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# BEWARE: This file is operated by slapgrid # BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically # BEWARE: It will be overwritten automatically
import os import os, errno
import subprocess import subprocess
from datetime import date from datetime import date
...@@ -26,8 +26,14 @@ if not os.path.exists(output_folder) or not os.path.isdir(output_folder): ...@@ -26,8 +26,14 @@ if not os.path.exists(output_folder) or not os.path.isdir(output_folder):
exit(1) exit(1)
today = date.today().strftime("%Y-%m-%d") today = date.today().strftime("%Y-%m-%d")
folder_today = os.path.join(output_folder, 'ApacheDex-%s' % today) folder_today = os.path.join(output_folder, 'ApacheDex-%s' % today)
if not os.path.exists(folder_today):
# XXX- don't raise if folder_today exist
try:
os.makedirs(folder_today) os.makedirs(folder_today)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(folder_today):
pass
else: raise
apachedex = "{{ apachedex_executable }}".strip() apachedex = "{{ apachedex_executable }}".strip()
argument_list = [apachedex, '--js-embed', '--out', argument_list = [apachedex, '--js-embed', '--out',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment