2 import boto.s3.connection
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,
14 calling_format = boto.s3.connection.OrdinaryCallingFormat())
15 return gateway.connection