summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill <bill@pixelspoke.com>2015-05-12 17:57:55 -0700
committerbill <bill@pixelspoke.com>2015-05-12 17:57:55 -0700
commitee380d4575bd7b5d2a7ade2ecf162043d34263db (patch)
treedab32bec6b5bc3644178f79492fce1e0b29f4dd0
parent23968a9ee955a05184a0b633b1bda2a2497ac6ba (diff)
Fix s3cmd output processing
Fix typo preventing s3cmd output from being processed. Add formatting support for s3cmd errors.
-rw-r--r--bin/user/S3upload.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/user/S3upload.py b/bin/user/S3upload.py
index 921c94c..3002c44 100644
--- a/bin/user/S3upload.py
+++ b/bin/user/S3upload.py
@@ -82,7 +82,7 @@ class S3uploadGenerator(weewx.reportengine.ReportGenerator):
try:
S3upload_cmd = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- stdout = s3upload_cmd.communicate()[0]
+ stdout = S3upload_cmd.communicate()[0]
stroutput = stdout.strip()
except OSError, e:
if e.errno == errno.ENOENT:
@@ -118,7 +118,9 @@ class S3uploadGenerator(weewx.reportengine.ReportGenerator):
S3upload_message = "executed in %0.2f seconds"
else:
# suspect we have an s3cmd error so display a message
- syslog.syslog(syslog.LOG_INFO, "S3upload: s3cmd reported errors: %s" % stroutput)
+ syslog.syslog(syslog.LOG_INFO, "S3upload: s3cmd reported errors")
+ for line in iter(stroutput.splitlines()):
+ syslog.syslog(syslog.LOG_INFO, "S3upload: s3cmd error: %s" % line)
S3upload_message = "executed in %0.2f seconds"
stop_ts = time.time()