From 657e75c5e1ce15864be3a04b70899564d3ce2ad7 Mon Sep 17 00:00:00 2001 From: Harry Rybacki Date: Wed, 11 Sep 2019 14:12:02 -0400 Subject: [PATCH] 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 --- novajoin/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/novajoin/base.py b/novajoin/base.py index 23a5b0a..022bc35 100644 --- a/novajoin/base.py +++ b/novajoin/base.py @@ -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: