From 9d028dbde5663576faea640c108b37564cf64f52 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 25 Jul 2019 13:02:37 -0400 Subject: [PATCH] Add log_id to redfish logs Since the get_event_log is combining the logs, provide log_id for calling software to optionally include to categorize. Change-Id: Ifafc456b689eb76588ee1102bd7a2c4d9c639ac4 --- pyghmi/redfish/command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 54b3a888..68af963d 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -1309,6 +1309,7 @@ class Command(object): entriesurl = loginfo.get('Entries', {}).get('@odata.id', None) if not entriesurl: continue + logid = loginfo.get('Id', '') entries = self._do_web_request(entriesurl, cache=False) if clear: # The clear is against the log service etag, not entries @@ -1332,6 +1333,7 @@ class Command(object): newloginfo = self._do_web_request(lurl, cache=False) for log in entries.get('Members', []): record = {} + record['log_id'] = logid parsedtime = parse_time(log.get('Created', '')) if parsedtime: entime = parsedtime + correction @@ -1339,7 +1341,6 @@ class Command(object): entime = entime.strftime('%Y-%m-%dT%H:%M:%S') else: record['timestamp'] = log.get('Created', '') - record['timestamp'] = entime.strftime('%Y-%m-%dT%H:%M:%S') record['message'] = log.get('Message', None) record['severity'] = _healthmap.get(