Update Fault class to pass error key up

While debugging nova-compute logs it was noted that error messages
were not being populated rather the fault_name was. Updating the
response we hand back to Nova to contain message within the
'error' key of the returned object.

Change-Id: I2e0f415a512e53261b1e366cd75b310dd06eec27
This commit is contained in:
Harry Rybacki 2019-09-11 14:12:02 -04:00
parent f32dd28f2e
commit 657e75c5e1
1 changed files with 3 additions and 2 deletions

View File

@ -717,9 +717,10 @@ class Fault(webob.exc.HTTPException):
fault_name = self._fault_names.get(code, "computeFault")
explanation = self.wrapped_exc.explanation
fault_data = {
fault_name: {
'error': {
'code': code,
'message': explanation}}
'message': explanation,
'fault_name': fault_name}}
if code == 413:
retry = self.wrapped_exc.headers.get('Retry-After', None)
if retry: