def __init__(self, host, path, mode, dryrun):
        """ Initialize.

        host is the bucket name.
        path is an object key prefix to use.

        """
        super(S3Store, self).__init__(host, "/" + path, mode, dryrun)

        self.bucketName = host

        self.keyPattern = re.compile(S3Store.theKeyPattern % ())

        # { fromVol: [diff] }
        self.diffs = None
        self.extraKeys = None

        logger.info("Listing %s contents...", self)

        try:
            # Orginary calling format returns a 301 without specifying a location.
            # Subdomain calling format does not require specifying the region.
            s3 = boto.s3.connection.S3Connection(
                # calling_format=boto.s3.connection.ProtocolIndependentOrdinaryCallingFormat(),
                calling_format=boto.s3.connection.SubdomainCallingFormat(),
                )
            # s3 = boto.connect_s3()   # Often fails with 301
            # s3 = boto.s3.connect_to_region('us-west-2')  # How would we know the region?
        except boto.exception.NoAuthHandlerFound:
            logger.error("Try putting S3 credentials into ~/.boto")
            raise

        self.bucket = s3.get_bucket(self.bucketName)
        self.isRemote = True
def __init__ ( self , host , path , mode , dryrun ) : super ( S3Store , self ) . __init__ ( host , "/" + path , mode , dryrun ) self . bucketName = host self . keyPattern = re . compile ( S3Store . theKeyPattern % ( ) ) self . diffs = None self . extraKeys = None logger . info ( "Listing %s contents..." , self ) try : s3 = boto . s3 . connection . S3Connection ( calling_format = boto . s3 . connection . SubdomainCallingFormat ( ) , ) except boto . exception . NoAuthHandlerFound : logger . error ( "Try putting S3 credentials into ~/.boto" ) raise self . bucket = s3 . get_bucket ( self . bucketName ) self . isRemote = True
Initialize.

        host is the bucket name.
        path is an object key prefix to use.