python function terminated un_Python exceptions.InvalidDNSNameError方法代码示例

# 需要导入模块: from botocore import exceptions [as 别名]

# 或者: from botocore.exceptions import InvalidDNSNameError [as 别名]

def switch_to_virtual_host_style(request, signature_version,

default_endpoint_url=None, **kwargs):

"""

This is a handler to force virtual host style s3 addressing no matter

the signature version (which is taken in consideration for the default

case). If the bucket is not DNS compatible an InvalidDNSName is thrown.

:param request: A AWSRequest object that is about to be sent.

:param signature_version: The signature version to sign with

:param default_endpoint_url: The endpoint to use when switching to a

virtual style. If None is supplied, the virtual host will be

constructed from the url of the request.

"""

if request.auth_path is not None:

# The auth_path has already been applied (this may be a

# retried request). We don't need to perform this

# customization again.

return

elif _is_get_bucket_location_request(request):

# For the GetBucketLocation response, we should not be using

# the virtual host style addressing so we can avoid any sigv4

# issues.

logger.debug("Request is GetBucketLocation operation, not checking "

"for DNS compatibility.")

return

parts = urlsplit(request.url)

request.auth_path = parts.path

path_parts = parts.path.split('/')

# Retrieve what the endpoint we will be prepending the bucket name to.

if default_endpoint_url is None:

default_endpoint_url = parts.netloc

if len(path_parts) > 1:

bucket_name = path_parts[1]

if not bucket_name:

# If the bucket name is empty we should not be checking for

# dns compatibility.

return

logger.debug('Checking for DNS compatible bucket for: %s',

request.url)

if check_dns_name(bucket_name):

# If the operation is on a bucket, the auth_path must be

# terminated with a '/' character.

if len(path_parts) == 2:

if request.auth_path[-1] != '/':

request.auth_path += '/'

path_parts.remove(bucket_name)

# At the very least the path must be a '/', such as with the

# CreateBucket operation when DNS style is being used. If this

# is not used you will get an empty path which is incorrect.

path = '/'.join(path_parts) or '/'

global_endpoint = default_endpoint_url

host = bucket_name + '.' + global_endpoint

new_tuple = (parts.scheme, host, path,

parts.query, '')

new_uri = urlunsplit(new_tuple)

request.url = new_uri

logger.debug('URI updated to: %s', new_uri)

else:

raise InvalidDNSNameError(bucket_name=bucket_name)

FAILED: CMakeFiles/cartographer.transform.timestamped_transform_test.dir/cartographer/transform/timestamped_transform_test.cc.o /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -DGFLAGS_IS_A_DLL=0 -I../cartographer -I. -I../ -isystem /usr/include/eigen3 -isystem /usr/include/lua5.2 -O3 -DNDEBUG -pthread -fPIC -Wall -Wpedantic -Werror=format-security -Werror=missing-braces -Werror=reorder -Werror=return-type -Werror=switch -Werror=uninitialized -O3 -DNDEBUG -pthread -fPIC -Wall -Wpedantic -Werror=format-security -Werror=missing-braces -Werror=reorder -Werror=return-type -Werror=switch -Werror=uninitialized -O3 -DNDEBUG -std=gnu++11 -MD -MT CMakeFiles/cartographer.transform.timestamped_transform_test.dir/cartographer/transform/timestamped_transform_test.cc.o -MF CMakeFiles/cartographer.transform.timestamped_transform_test.dir/cartographer/transform/timestamped_transform_test.cc.o.d -o CMakeFiles/cartographer.transform.timestamped_transform_test.dir/cartographer/transform/timestamped_transform_test.cc.o -c ../cartographer/transform/timestamped_transform_test.cc In file included from ../cartographer/transform/timestamped_transform_test.cc:17: ../cartographer/transform/timestamped_transform.h:21:10: fatal error: cartographer/transform/proto/timestamped_transform.pb.h: No such file or directory 21 | #include "cartographer/transform/proto/timestamped_transform.pb.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. [44/380] Building CXX object CMakeFiles/cartographer.sensor.internal.voxel_filter_test.dir/cartographer/sensor/internal/voxel_filter_test.cc.o
最新发布
07-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值