cert_audit: Sort the outputs by not_valid_after date

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
This commit is contained in:
Pengyu Lv 2023-04-28 11:14:28 +08:00
parent fe13bd3d0e
commit 0b4832bbf5

View File

@ -487,11 +487,13 @@ def main():
filter_func = lambda d: (start_date < d.not_valid_before) or \
(d.not_valid_after < end_date)
sortby_end = lambda d: d.not_valid_after
if args.all:
filter_func = None
# filter and output the results
for d in filter(filter_func, audit_results):
for d in sorted(filter(filter_func, audit_results), key=sortby_end):
list_all(d)
logger.debug("Done!")