Jon Chu
Jon Chu

Reputation: 1937

How to connect boto with fakes3

I'm wondering how I connect boto to fakes3 for integration testing.

I'm currently running fakes3 like so:

fakes3 -r fakes3 -p 4567

and attempting to connect to s3 and creating a bucket in ipython like this:

s3conn = S3Connection(access_key_id, secret_access_key, port=4567, host='localhost')
bucket = s3conn.create_bucket('test')

This just hangs. Can someone give me an example o connecting to fakes3 from boto?

Upvotes: 6

Views: 3951

Answers (2)

edilio
edilio

Reputation: 1868

this happen to me in a mac and I just realized that fakes3 didn't have permission to create files. So I ran sudo fakes3 -r /mnt/fakes3_root -p 4567 & and create_bucket and get_all_buckets worked fine

Upvotes: 0

garnaat
garnaat

Reputation: 45906

According to this (https://github.com/jubos/fake-s3/blob/master/test/botocmd.py) from the fakes3 tests, you probably want something like this:

from boto.s3.connection import S3Connection, OrdinaryCallingFormat

s3conn = S3Connection(access_key_id, secret_access_key, is_secure=False, port=4567, host='localhost', calling_format=OrdinaryCallingFormat())

Upvotes: 6

Related Questions