Permalink
Browse files

s3cmd info - fix to show correct md5sum for multipart uploaded file b…

…ased on custom md5 meta header
  • Loading branch information...
t3rm1n4l committed Nov 1, 2011
1 parent 077bf4c commit bd70d2b1fcac272021d7c3704e2ef8c4f89a8fed
Showing with 6 additions and 4 deletions.
  1. +2 −3 S3/S3.py
  2. +4 −1 s3cmd
View
@@ -341,9 +341,8 @@ def object_multipart_upload(self, filename, uri, cfg, extra_headers = None, extr
warning("File part size is less than minimum required size (5 MB). Disabled parallel multipart upload")
return self.object_put(filename, uri, extra_headers = extra_headers, extra_label = extra_label)
- uri_original = uri
- uri = S3Uri(uri.uri()+'_S3__tmp')
-
+ md5_hash = hash_file_md5(filename)
+ info("Calculating md5sum for %s" %filename)
headers = SortedDict(ignore_case = True)
if extra_headers:
headers.update(extra_headers)
View
5 s3cmd
@@ -573,7 +573,10 @@ def cmd_info(args):
output(u" File size: %s" % info['headers']['content-length'])
output(u" Last mod: %s" % info['headers']['last-modified'])
output(u" MIME type: %s" % info['headers']['content-type'])
- output(u" MD5 sum: %s" % info['headers']['etag'].strip('"'))
+ if info['headers'].has_key('x-amz-meta-md5sum'):
+ output(u" MD5 sum: %s" % info['headers']['x-amz-meta-md5sum'].strip('"'))
+ else:
+ output(u" MD5 sum: %s" % info['headers']['etag'].strip('"'))
else:
info = s3.bucket_info(uri)
output(u"%s (bucket):" % uri.uri())

0 comments on commit bd70d2b

Please sign in to comment.