diff --git a/pyghmi/exceptions.py b/pyghmi/exceptions.py index 8e2ce827..3c6427ef 100644 --- a/pyghmi/exceptions.py +++ b/pyghmi/exceptions.py @@ -27,7 +27,9 @@ class IpmiException(PyghmiException): class RedfishError(PyghmiException): - pass + def __init__(self, text='', msgid=None): + super(RedfishError, self).__init__(text) + self.msgid = msgid class UnrecognizedCertificate(Exception): diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 08b9896e..2d4ea85b 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -593,8 +593,12 @@ class Command(object): errmsg = [ x.get('Message', x['MessageId']) for x in info.get( 'error', {}).get('@Message.ExtendedInfo', {})] + msgid = [ + x['MessageId'] for x in info.get( + 'error', {}).get('@Message.ExtendedInfo', {})] errmsg = ','.join(errmsg) - raise exc.RedfishError(errmsg) + msgid = ','.join(msgid) + raise exc.RedfishError(errmsg, msgid=msgid) except (ValueError, KeyError): raise exc.PyghmiException(str(url) + ":" + res[0]) if payload is None and method is None: @@ -826,11 +830,10 @@ class Command(object): self._do_web_request(url, {'ResetType': action}) def set_identify(self, on=True, blink=None): - thetag = self.sysinfo.get('@odata.etag', None) self._do_web_request( self.sysurl, {'IndicatorLED': 'Blinking' if blink else 'Lit' if on else 'Off'}, - method='PATCH', etag=thetag) + method='PATCH', etag='*') _idstatemap = { 'Blinking': 'blink',