From 012d8f18b7bfbf785878c58b24e9a6e2c787e72a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 16 May 2019 10:02:37 -0400 Subject: [PATCH] Fallback to MessageId If an implementation provides no message, at least use the MessageID. Longer term this would be consulting the redfish registry to get the correct message with messageargs interpolated, but for the short term, at least provide this. Change-Id: I099745e929dbfa5b11d630966308f6986eef41e5 --- pyghmi/redfish/command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 8854f7e8..6fcc9b43 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -396,8 +396,8 @@ class Command(object): try: info = json.loads(res[0]) errmsg = [ - x['Message'] for x in info.get('error', {}).get( - '@Message.ExtendedInfo', {})] + x.get('Message', x['MessageId']) for x in info.get( + 'error', {}).get('@Message.ExtendedInfo', {})] errmsg = ','.join(errmsg) raise exc.RedfishError(errmsg) except (ValueError, KeyError):