]>
Commit | Line | Data |
---|---|---|
31f18b77 FG |
1 | import boto |
2 | import boto.s3.connection | |
3 | ||
4 | ||
5 | def get_gateway_connection(gateway, credentials): | |
6 | """ connect to the given gateway """ | |
7 | if gateway.connection is None: | |
8 | gateway.connection = boto.connect_s3( | |
9 | aws_access_key_id = credentials.access_key, | |
10 | aws_secret_access_key = credentials.secret, | |
11 | host = gateway.host, | |
12 | port = gateway.port, | |
13 | is_secure = False, | |
14 | calling_format = boto.s3.connection.OrdinaryCallingFormat()) | |
15 | return gateway.connection | |
16 |