X-Git-Url: https://wylark.com/src/infoex-autowx.git/blobdiff_plain/64929d40db7dc9acb29005ac624f8dd13aefc335..cd8a117607f982fe0a6c5f66bc8639274bc9ca02:/infoex-autowx.py?ds=inline diff --git a/infoex-autowx.py b/infoex-autowx.py index d6edf5e..ea91bef 100755 --- a/infoex-autowx.py +++ b/infoex-autowx.py @@ -27,6 +27,7 @@ import configparser import csv import datetime import logging +import os import sys import time @@ -239,11 +240,13 @@ with open(infoex['csv_filename'], 'w') as f: f.close() if not options.dry_run: + # not a dry run with open(infoex['csv_filename'], 'rb') as f: log.debug("uploading FTP file '%s'" % (infoex['host'])) ftp = FTP(infoex['host'], infoex['uuid'], infoex['api_key']) ftp.storlines('STOR ' + infoex['csv_filename'], f) ftp.close() f.close() + os.remove(infoex['csv_filename']) log.debug('DONE')