fix check_scrutiny_disks
This commit is contained in:
parent
385ee78b5e
commit
9fe6e7586e
|
@ -55,6 +55,7 @@ def get_smart_health(wwn_id: str, scrutiny_endpoint: str) -> dict:
|
|||
def main(args):
|
||||
results = {}
|
||||
wwn_ids = get_disk_wwn_ids(args.ignore_non_smart)
|
||||
metics_out_of_date = False
|
||||
for wwn_id in wwn_ids:
|
||||
smart_health = get_smart_health(wwn_id, args.scrutiny_endpoint)
|
||||
|
||||
|
@ -73,8 +74,6 @@ def main(args):
|
|||
last_updated = datetime.strptime(smart_health['data']['device']['UpdatedAt'][:-4] + 'Z', '%Y-%m-%dT%H:%M:%S.%fZ')
|
||||
if datetime.utcnow() - timedelta(hours=args.time_delta_limit) > last_updated:
|
||||
metics_out_of_date = True
|
||||
else:
|
||||
metics_out_of_date = False
|
||||
|
||||
if smart_health:
|
||||
for attribute_id, values in smart_health['data']['smart_results'][0]['attrs'].items():
|
||||
|
|
Loading…
Reference in New Issue