def _get_raw_data(job_binary, conn):
    names = _get_names_from_url(job_binary.url)
    container, obj = names

    # if container name has '.sahara' suffix we need to strip it
    if container.endswith(su.SWIFT_URL_SUFFIX):
        container = container[:-len(su.SWIFT_URL_SUFFIX)]

    try:
        # First check the size
        headers = conn.head_object(container, obj)
        total_KB = int(headers.get('content-length', 0)) / 1024.0
        if total_KB > CONF.job_binary_max_KB:
            raise ex.DataTooBigException(
                round(total_KB, 1), CONF.job_binary_max_KB,
                _("Size of swift object (%(size)sKB) is greater "
                  "than maximum (%(maximum)sKB)"))

        headers, body = conn.get_object(container, obj)
    except swiftclient.ClientException as e:
        raise ex.SwiftClientException(six.text_type(e))

    return body
dataset/ETHPy150Open openstack/sahara/sahara/service/edp/binary_retrievers/internal_swift.py/_get_raw_data/original