From: <lu...@us...> - 2010-05-20 12:01:07
|
Revision: 411 http://s3tools.svn.sourceforge.net/s3tools/?rev=411&view=rev Author: ludvigm Date: 2010-05-20 12:01:01 +0000 (Thu, 20 May 2010) Log Message: ----------- * s3cmd, S3/S3.py, S3/Config.py: Added --reduced-redundancy switch for Reduced Redundancy Storage. Modified Paths: -------------- s3cmd/trunk/ChangeLog s3cmd/trunk/S3/Config.py s3cmd/trunk/S3/S3.py s3cmd/trunk/s3cmd Modified: s3cmd/trunk/ChangeLog =================================================================== --- s3cmd/trunk/ChangeLog 2010-05-20 11:42:47 UTC (rev 410) +++ s3cmd/trunk/ChangeLog 2010-05-20 12:01:01 UTC (rev 411) @@ -1,3 +1,8 @@ +2010-05-21 Michal Ludvig <ml...@lo...> + + * s3cmd, S3/S3.py, S3/Config.py: Added --reduced-redundancy + switch for Reduced Redundancy Storage. + 2010-05-20 Michal Ludvig <ml...@lo...> * s3cmd, S3/ACL.py, S3/Config.py: Support for --acl-grant Modified: s3cmd/trunk/S3/Config.py =================================================================== --- s3cmd/trunk/S3/Config.py 2010-05-20 11:42:47 UTC (rev 410) +++ s3cmd/trunk/S3/Config.py 2010-05-20 12:01:01 UTC (rev 411) @@ -73,6 +73,7 @@ encoding = "utf-8" urlencoding_mode = "normal" log_target_prefix = "" + reduced_redundancy = False ## Creating a singleton def __new__(self, configfile = None): Modified: s3cmd/trunk/S3/S3.py =================================================================== --- s3cmd/trunk/S3/S3.py 2010-05-20 11:42:47 UTC (rev 410) +++ s3cmd/trunk/S3/S3.py 2010-05-20 12:01:01 UTC (rev 411) @@ -255,6 +255,8 @@ headers["content-type"] = content_type if self.config.acl_public: headers["x-amz-acl"] = "public-read" + if self.config.reduced_redundancy: + headers["x-amz-storage-class"] = "REDUCED_REDUNDANCY" request = self.create_request("OBJECT_PUT", uri = uri, headers = headers) labels = { 'source' : unicodise(filename), 'destination' : unicodise(uri.uri()), 'extra' : extra_label } response = self.send_file(request, file, labels) @@ -286,6 +288,8 @@ headers['x-amz-metadata-directive'] = "COPY" if self.config.acl_public: headers["x-amz-acl"] = "public-read" + if self.config.reduced_redundancy: + headers["x-amz-storage-class"] = "REDUCED_REDUNDANCY" # if extra_headers: # headers.update(extra_headers) request = self.create_request("OBJECT_PUT", uri = dst_uri, headers = headers) Modified: s3cmd/trunk/s3cmd =================================================================== --- s3cmd/trunk/s3cmd 2010-05-20 11:42:47 UTC (rev 410) +++ s3cmd/trunk/s3cmd 2010-05-20 12:01:01 UTC (rev 411) @@ -1597,6 +1597,7 @@ optparser.add_option( "--rinclude-from", dest="rinclude_from", action="append", metavar="FILE", help="Read --rinclude REGEXPs from FILE") optparser.add_option( "--bucket-location", dest="bucket_location", help="Datacentre to create bucket in. Either EU or US (default)") + optparser.add_option( "--reduced-redundancy", "--rr", dest="reduced_redundancy", action="store_true", help="Store object with 'Reduced redundancy'. Lower per-GB price. [put, cp, mv]") optparser.add_option( "--log-target-prefix", dest="log_target_prefix", help="Target prefix for access logs (S3 URI)") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |