Browse Source

Fix for uploading new files...

main
John-Mark Gurney 7 years ago
parent
commit
478e52a624
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      publishers/s3.py

+ 4
- 3
publishers/s3.py View File

@@ -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:


Loading…
Cancel
Save