summaryrefslogtreecommitdiffstats
path: root/src/test/rgw/rgw_multi/conn.py
blob: 1099664df201b55c09685bde9985a984127238fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import boto
import boto.s3.connection


def get_gateway_connection(gateway, credentials):
    """ connect to the given gateway """
    if gateway.connection is None:
        gateway.connection = boto.connect_s3(
                aws_access_key_id = credentials.access_key,
                aws_secret_access_key = credentials.secret,
                host = gateway.host,
                port = gateway.port,
                is_secure = False,
                calling_format = boto.s3.connection.OrdinaryCallingFormat())
    return gateway.connection