Amazon web services 使用moto进行AWS冰川模拟失败

Amazon web services 使用moto进行AWS冰川模拟失败,amazon-web-services,amazon-glacier,moto,Amazon Web Services,Amazon Glacier,Moto,我试图模拟简单的冰川调用(创建和删除冰川拱顶),但找不到解决方法(尽管能够使用S3实现如此简单的模拟,创建一个桶) 对冰川的嘲弄似乎根本没有被考虑在内 代码如下: 导入boto3 从莫托进口莫克冰川 使用模拟冰川() 冰川资源=boto3.资源(“冰川”,区域名称=“假冰川区域”) vault=glacier\u资源。创建\u vault(accountId='-',vaultName=“false.glacier.name”) 在创建vault时,我会遇到以下异常: Traceback (m

我试图模拟简单的冰川调用(创建和删除冰川拱顶),但找不到解决方法(尽管能够使用S3实现如此简单的模拟,创建一个桶)

对冰川的嘲弄似乎根本没有被考虑在内

代码如下:

导入boto3
从莫托进口莫克冰川
使用模拟冰川()
冰川资源=boto3.资源(“冰川”,区域名称=“假冰川区域”)
vault=glacier\u资源。创建\u vault(accountId='-',vaultName=“false.glacier.name”)
在创建vault时,我会遇到以下异常:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/<...>/test_mock_glacier.py", line 9, in test_simplest
    vault = glacier_resource.create_vault(accountId='-', vaultName="fake.glacier.name")
  File "/<...>/.local/lib/python3.7/site-packages/boto3/resources/factory.py", line 520, in do_action
    response = action(self, *args, **kwargs)
  File "/<...>/.local/lib/python3.7/site-packages/boto3/resources/action.py", line 83, in __call__
    response = getattr(parent.meta.client, operation_name)(*args, **params)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/client.py", line 663, in _make_api_call
    operation_model, request_dict, request_context)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/client.py", line 682, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 137, in _send_request
    success_response, exception):
  File "/<...>/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 256, in _needs_retry
    caught_exception=caught_exception, request_dict=request_dict)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 183, in __call__
    if self._checker(attempts, response, caught_exception):
  File "/<...>/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 251, in __call__
    caught_exception)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 277, in _should_retry
    return self._checker(attempt_number, response, caught_exception)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 317, in __call__
    caught_exception)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 223, in __call__
    attempt_number, caught_exception)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
    raise caught_exception
  File "/<...>/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 200, in _do_get_response
    http_response = self._send(request)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 269, in _send
    return self.http_session.send(request)
  File "/<...>/.local/lib/python3.7/site-packages/botocore/httpsession.py", line 343, in send
    raise EndpointConnectionError(endpoint_url=request.url, error=e)
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://glacier.fake-glacier-region.amazonaws.com/-/vaults/fake.glacier.name"
(在设置moto自述文件中所述的模拟
AWS\u访问密钥ID
AWS\u机密访问密钥
AWS\u安全令牌
AWS\u会话密钥
环境变量(以
'testing'
作为值)时)

冰川拱顶不能在其名称中包含

正在进行中(合并到master中,将与2.0.9版一起发布)

因此,Quickfix将
vaultName=“fake.glacier.name”
更改为
vaultName=“fakeGlacierName”

botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the CreateVault operation: The security token included in the request is invalid.