s3_util.py
def create_client(stage_info, use_accelerate_endpoint=False):
        """
        Creates a client object with a stage credential
        :param stage_credentials: a stage credential
        :param use_accelerate_endpoint: is accelerate endpoint?
        :return: client
        """
        logger = getLogger(__name__)
        stage_credentials = stage_info[u'creds']
        security_token = stage_credentials.get(u'AWS_TOKEN', None)
        end_point = stage_info['endPoint']
        logger.debug(u"AWS_KEY_ID: %s", stage_credentials[u'AWS_KEY_ID'])

        # if GS sends us an endpoint, it's likely for FIPS. Use it.
        end_point = (u'https://' + stage_info['endPoint']) if stage_info['endPoint'] else None

        config = Config(
            signature_version=u's3v4',
            s3={
                'use_accelerate_endpoint': use_accelerate_endpoint,
                'addressing_style': ADDRESSING_STYLE
            })
        client = boto3.resource(
            u's3',
            region_name=stage_info['region'],
            aws_access_key_id=stage_credentials[u'AWS_KEY_ID'],
            aws_secret_access_key=stage_credentials[u'AWS_SECRET_KEY'],
            aws_session_token=security_token,
            endpoint_url=end_point,
            config=config,
        )
        return client

        Creates a client object with a stage credential
        :param stage_credentials: a stage credential
        :param use_accelerate_endpoint: is accelerate endpoint?
        :return: client
        
Creates a client object with a stage credential
Creates a client object with a stage credential
def create_client(stage_info, use_accelerate_endpoint=False):
        logger = getLogger(__name__)
        stage_credentials = stage_info[u'creds']
        security_token = stage_credentials.get(u'AWS_TOKEN', None)
        end_point = stage_info['endPoint']
        logger.debug(u"AWS_KEY_ID: %s", stage_credentials[u'AWS_KEY_ID'])
        end_point = (u'https://' + stage_info['endPoint']) if stage_info['endPoint'] else None
        config = Config(
            signature_version=u's3v4',
            s3={
                'use_accelerate_endpoint': use_accelerate_endpoint,
                'addressing_style': ADDRESSING_STYLE
            })
        client = boto3.resource(
            u's3',
            region_name=stage_info['region'],
            aws_access_key_id=stage_credentials[u'AWS_KEY_ID'],
            aws_secret_access_key=stage_credentials[u'AWS_SECRET_KEY'],
            aws_session_token=security_token,
            endpoint_url=end_point,
            config=config,
        )
        return client
def create_client ( stage_info , use_accelerate_endpoint = False ) : logger = getLogger ( __name__ ) stage_credentials = stage_info [ u'creds' ] security_token = stage_credentials . get ( u'AWS_TOKEN' , None ) end_point = stage_info [ 'endPoint' ] logger . debug ( u"AWS_KEY_ID: %s" , stage_credentials [ u'AWS_KEY_ID' ] ) end_point = ( u'https://' + stage_info [ 'endPoint' ] ) if stage_info [ 'endPoint' ] else None config = Config ( signature_version = u's3v4' , s3 = { 'use_accelerate_endpoint' : use_accelerate_endpoint , 'addressing_style' : ADDRESSING_STYLE } ) client = boto3 . resource ( u's3' , region_name = stage_info [ 'region' ] , aws_access_key_id = stage_credentials [ u'AWS_KEY_ID' ] , aws_secret_access_key = stage_credentials [ u'AWS_SECRET_KEY' ] , aws_session_token = security_token , endpoint_url = end_point , config = config , ) return client
Creates a client object with a stage credential
Creates a client object with a stage credential
"""
        Creates a client object with a stage credential
        :param stage_credentials: a stage credential
        :param use_accelerate_endpoint: is accelerate endpoint?
        :return: client
        """ # if GS sends us an endpoint, it's likely for FIPS. Use it.
None
stage_info
use_accelerate_endpoint
None
stage_credentials
a stage credential
a stage credential