Created
September 30, 2010 15:54
-
-
Save jingoro/604803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- botobackend.py.orig 2010-07-25 16:14:39.000000000 +0000 | |
+++ botobackend.py 2010-09-30 15:52:41.000000000 +0000 | |
@@ -146,7 +146,7 @@ | |
else: | |
self.conn.calling_format = calling_format | |
- else: | |
+ elif self.bucket_name is None: | |
# Duplicity hangs if boto gets a null bucket name. | |
# HC: Caught a socket error, trying to recover | |
raise BackendException('Boto requires a bucket name.') | |
@@ -186,11 +186,11 @@ | |
# sleep before retry (new connection to a **hopeful** new host, so no need to wait so long) | |
time.sleep(10) | |
- log.Info("Uploading %s/%s to %s Storage" % (self.straight_url, remote_filename, | |
- 'REDUCED_REDUNDANCY' if globals.s3_use_rrs else 'STANDARD')) | |
+ log.Info("Uploading %s/%s to %s Storage" % (self.straight_url, remote_filename, | |
+ globals.s3_use_rrs and 'REDUCED_REDUNDANCY' or 'STANDARD')) | |
try: | |
key.set_contents_from_filename(source_path.name, {'Content-Type': 'application/octet-stream', | |
- 'x-amz-storage-class': 'REDUCED_REDUNDANCY' if globals.s3_use_rrs else 'STANDARD'}) | |
+ 'x-amz-storage-class': globals.s3_use_rrs and 'REDUCED_REDUNDANCY' or 'STANDARD'}) | |
key.close() | |
self.resetConnection() | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment