From 478e52a624adbd185524d8f0379b0a4235f7cfd0 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 13 Mar 2017 12:55:10 -0700 Subject: [PATCH] Fix for uploading new files... --- publishers/s3.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/publishers/s3.py b/publishers/s3.py index 89025d3..85dbe25 100644 --- a/publishers/s3.py +++ b/publishers/s3.py @@ -45,9 +45,10 @@ class S3(Publisher): if redirect['from'] in item.path: redirect_meta = redirect['to'] k.key = item.path.replace(str(root), '') - kmd5 = bucket.get_key(item.path.replace(str(root), '')).etag[1:-1] - #print 'f:', `kmd5, k.compute_md5(open(item.path))[0]` - if kmd5 != k.compute_md5(open(item.path))[0]: + kmd5 = bucket.get_key(item.path.replace(str(root), '')) + print 'f:', `item.path`, `kmd5.etag[1:-1], k.compute_md5(open(item.path))[0]` + if kmd5 is None or \ + kmd5.etag[1:-1] != k.compute_md5(open(item.path))[0]: print 'updating:', `item.path.replace(str(root), '')` k.set_contents_from_filename(item.path) if redirect_meta: