diff --git a/bin/boto-rsync b/bin/boto-rsync index 76278b2..6668d4e 100644 --- a/bin/boto-rsync +++ b/bin/boto-rsync @@ -24,6 +24,7 @@ import sys, os, time, datetime, argparse, threading, signal from fnmatch import fnmatch import boto +import boto.s3.connection __version__ = '0.8.1' @@ -204,6 +205,15 @@ def main(): help='Connect without credentials (S3 only). Useful if working ' + \ 'with others\' buckets that have a global read/write ACL.' ) + parser.add_argument( + '--insecure', action='store_true', + help='Connect without SSL' + ) + parser.add_argument( + '--ordinarycallingformat' , action='store_true', + help='Connect with the old connection type ' + \ + '(no subdomain and Bucket upper case).' + ) parser.add_argument( '--endpoint', metavar='HOST', default='s3.amazonaws.com', help='Specify a specific S3 endpoint to connect to via boto\'s ' + \ @@ -312,6 +322,8 @@ def main(): cloud_access_key_id = args.cloud_access_key_id cloud_secret_access_key = args.cloud_secret_access_key anon = args.anon + ordinarycallingformat = args.ordinarycallingformat + insecure = args.insecure endpoint = args.endpoint grant = args.grant metadata = args.metadata @@ -410,16 +422,22 @@ def main(): # Connect to Cloud + parameters = {} if cloud_service == 'gs': - c = boto.connect_gs(gs_access_key_id=cloud_access_key_id, - gs_secret_access_key=cloud_secret_access_key) + parameters['gs_access_key_id'] = cloud_access_key_id + parameters['gs_secret_access_key'] = cloud_secret_access_key else: + parameters['host'] = endpoint if anon: - c = boto.connect_s3(host=endpoint, anon=True) + parameters['anon'] = True else: - c = boto.connect_s3(aws_access_key_id=cloud_access_key_id, - aws_secret_access_key=cloud_secret_access_key, - host=endpoint) + parameters['aws_access_key_id'] = cloud_access_key_id + parameters['aws_secret_access_key'] = cloud_secret_access_key + if ordinarycallingformat: + parameters['calling_format'] = boto.s3.connection.OrdinaryCallingFormat() + if insecure: + parameters['is_secure'] = False + c = boto.connect_s3(**parameters) c.debug = debug b = c.get_bucket(cloud_bucket) if xfer_type in ['sync']: