garnaat / placebo

Make boto3 calls that look real but have no effect.
Apache License 2.0
394 stars 28 forks source link

fake http response needs a raw attribute #75

Open kapilt opened 4 years ago

kapilt commented 4 years ago

some of the s3 request/response handlers in latest boto expect that attribute, though they all seem to short circuit cleanly if the value is None.

    v = method(Bucket=b['Name'])                                                                                                                                                             
  File "/Users/kapilt/.pyenv/versions/3.8.2/envs/c7n-poet-v1/lib/python3.8/site-packages/botocore/client.py", line 316, in _api_call
    return self._make_api_call(operation_name, kwargs)                                                                                                                                        
  File "/Users/kapilt/.pyenv/versions/3.8.2/envs/c7n-poet-v1/lib/python3.8/site-packages/botocore/client.py", line 615, in _make_api_call                                                     
    self.meta.events.emit(                                                              
  File "/Users/kapilt/.pyenv/versions/3.8.2/envs/c7n-poet-v1/lib/python3.8/site-packages/botocore/hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)                             
  File "/Users/kapilt/.pyenv/versions/3.8.2/envs/c7n-poet-v1/lib/python3.8/site-packages/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)                   
  File "/Users/kapilt/.pyenv/versions/3.8.2/envs/c7n-poet-v1/lib/python3.8/site-packages/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)                               
  File "/Users/kapilt/.pyenv/versions/3.8.2/envs/c7n-poet-v1/lib/python3.8/site-packages/botocore/handlers.py", line 487, in parse_get_bucket_location
    if http_response.raw is None:                                     
AttributeError: 'FakeHttpResponse' object has no attribute 'raw'