# Buggy code
def to_dict(self):
    return {
        "CreationDate": "2013-03-20T17:03:43.221Z",
        "LastInventoryDate": "2013-03-20T17:03:43.221Z",
        "NumberOfArchives": None,
        "SizeInBytes": None,
        "VaultARN": self.arn,
        "VaultName": self.vault_name,
    }


# Traceback (AttributeError)
127.0.0.1 - - [06/Sep/2017 14:40:32] "POST /kefo/vaults/testvault/archives HTTP/1.1" 500 -
Error on request:
Traceback (most recent call last):
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/werkzeug/serving.py", line 209, in run_wsgi
execute(self.server.app)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/werkzeug/serving.py", line 197, in execute
application_iter = app(environ, start_response)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/moto/server.py", line 92, in __call__
return backend_app(environ, start_response)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/moto/core/utils.py", line 131, in __call__
result = self.callback(request, request.url, {})
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/moto/glacier/responses.py", line 71, in vault_archive_response
return response_instance._vault_archive_response(request, full_url, headers)
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/moto/glacier/responses.py", line 75, in _vault_archive_response
body = request.body
File "/Users/kford1/Work/motoenv/lib/python3.5/site-packages/werkzeug/local.py", line 347, in __getattr__
return getattr(self._get_current_object(), name)
AttributeError: 'Request' object has no attribute 'body'

# Fixed code
def to_dict(self):
    archives_size = 0
    for k in self.archives:
        archives_size += self.archives[k]["size"]
    d = {
        "CreationDate": self.st.strftime("%Y-%m-%dT%H:%M:%S.000Z"),
        "LastInventoryDate": self.st.strftime("%Y-%m-%dT%H:%M:%S.000Z"),
        "NumberOfArchives": len(self.archives),
        "SizeInBytes": archives_size,
        "VaultARN": self.arn,
        "VaultName": self.vault_name,
    }
    return d