mirror of https://github.com/evilhero/mylar
FIX: DDL Quietly Fails if /ddl_location is set to a location that doesn't exist (#2278)
This commit is contained in:
parent
2776f47198
commit
32bacb4e30
|
@ -375,6 +375,14 @@ class GC(object):
|
||||||
#write the filename to the db for tracking purposes...
|
#write the filename to the db for tracking purposes...
|
||||||
myDB.upsert('ddl_info', {'filename': filename, 'remote_filesize': remote_filesize}, {'id': id})
|
myDB.upsert('ddl_info', {'filename': filename, 'remote_filesize': remote_filesize}, {'id': id})
|
||||||
|
|
||||||
|
if mylar.CONFIG.DDL_LOCATION is not None and not os.path.isdir(mylar.CONFIG.DDL_LOCATION):
|
||||||
|
checkdirectory = mylar.filechecker.validateAndCreateDirectory(mylar.CONFIG.DDL_LOCATION, True)
|
||||||
|
if not checkdirectory:
|
||||||
|
logger.warn('[ABORTING] Error trying to validate/create DDL download directory: %s.' % mylar.CONFIG.DDL_LOCATION)
|
||||||
|
return ({"success": False,
|
||||||
|
"filename": filename,
|
||||||
|
"path": None})
|
||||||
|
|
||||||
path = os.path.join(mylar.CONFIG.DDL_LOCATION, filename)
|
path = os.path.join(mylar.CONFIG.DDL_LOCATION, filename)
|
||||||
|
|
||||||
if t.headers.get('content-encoding') == 'gzip': #.get('Content-Encoding') == 'gzip':
|
if t.headers.get('content-encoding') == 'gzip': #.get('Content-Encoding') == 'gzip':
|
||||||
|
|
Loading…
Reference in New Issue