2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

Convert to localtime

The IPMI module returned localtime, be consistent with that behavior.

Change-Id: I7a787ffb4b9aac81e54cc20707e97087a97d5d16
This commit is contained in:
Jarrod Johnson 2019-04-22 15:54:26 -04:00
parent 5979a2b215
commit 13c7d6d3b5

View File

@ -764,7 +764,6 @@ class Command(object):
if currtime:
currtime = _parse_time(currtime)
now = datetime.now(tz.tzoffset('', 0))
correction
try:
correction = now - currtime
except TypeError:
@ -801,6 +800,7 @@ class Command(object):
for log in entries.get('Members', []):
record = {}
entime = _parse_time(log.get('Created', '')) + correction
entime = entime.astimezone(tz.gettz())
record['timestamp'] = entime.strftime('%Y-%m-%dT%H:%M:%S')
record['message'] = log.get('Message', None)
record['severity'] = _healthmap.get(