def add_glacier_checksums(params, **kwargs):
 request_dict = params
 headers = request_dict['headers']
 body = request_dict['body']
 if isinstance(body, six.binary_type):
  body = six.BytesIO(body)
 starting_position = body.tell()
 if ('x-amz-content-sha256' not in headers):
  headers['x-amz-content-sha256'] = utils.calculate_sha256(body, as_hex=True)
 body.seek(starting_position)
 if ('x-amz-sha256-tree-hash' not in headers):
  headers['x-amz-sha256-tree-hash'] = utils.calculate_tree_hash(body)
 body.seek(starting_position)

def add_glacier_checksums ( params , ** kwargs ) : request_dict = params headers = request_dict [ 'headers' ] body = request_dict [ 'body' ] if isinstance ( body , six . binary_type ) : body = six . BytesIO ( body ) starting_position = body . tell ( ) if ( 'x-amz-content-sha256' not in headers ) : headers [ 'x-amz-content-sha256' ] = utils . calculate_sha256 ( body , as_hex = True ) body . seek ( starting_position ) if ( 'x-amz-sha256-tree-hash' not in headers ) : headers [ 'x-amz-sha256-tree-hash' ] = utils . calculate_tree_hash ( body ) body . seek ( starting_position )
add glacier checksums to the http request .