X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Frgw%2Frgw_multi%2Fconn.py;fp=src%2Fceph%2Fsrc%2Ftest%2Frgw%2Frgw_multi%2Fconn.py;h=1099664df201b55c09685bde9985a984127238fe;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/test/rgw/rgw_multi/conn.py b/src/ceph/src/test/rgw/rgw_multi/conn.py new file mode 100644 index 0000000..1099664 --- /dev/null +++ b/src/ceph/src/test/rgw/rgw_multi/conn.py @@ -0,0 +1,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 +