check_scrutiny_disks: fix date parsing
This commit is contained in:
parent
7d383347f4
commit
20b7fb2d68
|
@ -79,7 +79,7 @@ def main(args):
|
||||||
# For testing
|
# For testing
|
||||||
# smart_health['data']['device']['UpdatedAt'] = '2023-04-28T23:00:03.071184465Z'
|
# smart_health['data']['device']['UpdatedAt'] = '2023-04-28T23:00:03.071184465Z'
|
||||||
|
|
||||||
last_updated = datetime.strptime(smart_health['data']['device']['UpdatedAt'][:-4] + 'Z', '%Y-%m-%dT%H:%M:%S.%fZ')
|
last_updated = datetime.strptime(smart_health['data']['device']['UpdatedAt'][:-10] + smart_health['data']['device']['UpdatedAt'][-6:], '%Y-%m-%dT%H:%M:%S.%f%z')
|
||||||
if datetime.utcnow() - timedelta(hours=args.time_delta_limit) > last_updated:
|
if datetime.utcnow() - timedelta(hours=args.time_delta_limit) > last_updated:
|
||||||
metrics_out_of_date = True
|
metrics_out_of_date = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue