check for data directory existence for the sake of logging

This commit is contained in:
Nicholas St. Germain 2018-12-17 22:08:33 -06:00
parent 5cfbbe7a99
commit 7f04419d4c

View file

@ -7,7 +7,7 @@ from urllib3 import disable_warnings
from os import stat, remove, makedirs
from urllib.request import urlretrieve
from json.decoder import JSONDecodeError
from os.path import abspath, join, basename
from os.path import abspath, join, basename, isdir
from urllib3.exceptions import InsecureRequestWarning
from requests.exceptions import InvalidSchema, SSLError, ConnectionError
@ -108,6 +108,7 @@ def connection_handler(session, request, verify):
def mkdir_p(path):
templogger = getLogger('temp')
try:
if not isdir(path):
templogger.info('Creating folder %s ', path)
makedirs(path, exist_ok=True)
except Exception as e: