From 8aab9ddffa996d949970f28bfc774fc297c093d1 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Sep 28 2023 19:18:07 +0000 Subject: Order CSV files and printed lists by user ID --- diff --git a/find_inactive_packagers.py b/find_inactive_packagers.py index cedb5e3..8fbc9fc 100644 --- a/find_inactive_packagers.py +++ b/find_inactive_packagers.py @@ -654,7 +654,7 @@ def step_one(ctx, with_bz_check, open_tickets): if packager_email_map: with open('inactive_packagers.csv', 'w') as fout: - for user, emails in packager_email_map.items(): + for user, emails in sorted(packager_email_map.items()): # Open Pagure tickets ticket_id = 'NONE' tktags = [PAGURE_NEW_TICKET_TAG] @@ -759,6 +759,7 @@ def step_two(ctx, with_bz_check, close_tickets, from_file): if _check_user_activity(p, privacy=privacy, fasclient=fasclient, bzclient=bzclient): pending_removal_users.remove(p) if pending_removal_users: + pending_removal_user.sort() log.info(f'### These {len(pending_removal_users)} users didn\'t react to previous inquiry: ###') with open('still_inactive.csv', 'w') as finactive: for user in pending_removal_users: @@ -781,6 +782,7 @@ def step_two(ctx, with_bz_check, close_tickets, from_file): resumed_activity.append((user, ticket_id)) if confirmed_removal: + confirmed_removal.sort() log.info(f'### These {len(confirmed_removal)} users didn\'t reply and are going to be removed from packagers: ###') for user, ticket in confirmed_removal: log.info(f'- {user}') @@ -789,16 +791,18 @@ def step_two(ctx, with_bz_check, close_tickets, from_file): if pending: log.info(f'### These users agreed to be removed from packagers: ###') - for user, ticket_id in pending.items(): + for user, ticket_id in sorted(pending.items()): log.info(f'- {user}') confirmed_removal.append((user, ticket_id)) if resumed_activity: + resumed_activity.sort() log.info(f'### These {len(resumed_activity)} users resumed activity: ###') for user, ticket_id in resumed_activity: log.info(f'- {user}') if confirmed_removal: + confirmed_removal.sort() if close_tickets: log.info(f'### Closing tickets and generating output file ###') for user, ticket_id in resumed_activity: