X-Git-Url: https://wylark.com/src/infoex-autowx.git/blobdiff_plain/760a81ad34208fb461e57ca2e06db42166231957..a585efb4e491a6a2dab7df5e858b34fe5235f662:/infoex-autowx.py 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')