Comment 1 for bug 1568677

Revision history for this message
Florian Kruse (fkruse) wrote : Re: duplicity failing to use existing bucket in boto backend

Modifying resetConnection to

    def resetConnection(self):
        import boto
        if getattr(self, 'conn', False):
            self.conn.close()
        self.bucket = None
        self.conn = None
        self.storage_uri = None
        del self.conn
        del self.storage_uri
        self.storage_uri = boto.storage_uri(self.boto_uri_str)
        self.conn = get_connection(self.scheme, self.parsed_url, self.storage_uri)
        if not self.conn.lookup(self.bucket_name):
            if globals.s3_european_buckets:
                self.bucket = self.conn.create_bucket(self.bucket_name,
                                                      location=Location.EU)
            else:
                self.bucket = self.conn.create_bucket(self.bucket_name)
        else:
            self.bucket = self.conn.get_bucket(self.bucket_name)

seems to resolve the issue. Although, I am not sure if this is wise (found this while trial-and-erroring through the file).