def deleteFiles(report_name):
""" Delete a file in the report environment """
import shutil
if request.form.get('SCRIPT') is not None:
deletedLocation = os.path.join(current_app.config['ROOT_PATH'], config.ARES_USERS_DELETED_FOLDERS)
if not os.path.exists(deletedLocation):
os.makedirs(deletedLocation)
# Move the file to the deleted Location
# This folder should be purged every month
shutil.move(os.path.join(current_app.config['ROOT_PATH'], config.ARES_USERS_LOCATION, report_name, request.form.get('SCRIPT')),
os.path.join(deletedLocation, "%s_%s" % (report_name, request.form.get('SCRIPT'))))
appendToLog(report_name, 'DELETE', request.form.get('SCRIPT'))
return json.dumps({'SCRIPT': request.form.get('SCRIPT'), 'ENV': report_name})
#TO BE REMOVED
评论列表
文章目录