From 4a9b4e10dff26ae6928288678fd80a75ae949595 Mon Sep 17 00:00:00 2001 From: djperrefort Date: Fri, 30 Aug 2024 10:58:11 -0400 Subject: [PATCH] Treat expired requests as list to fix indexing error --- apps/crc_proposal_end.py | 2 +- apps/crc_sus.py | 2 +- apps/crc_usage.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/crc_proposal_end.py b/apps/crc_proposal_end.py index af202ec..e2fe248 100755 --- a/apps/crc_proposal_end.py +++ b/apps/crc_proposal_end.py @@ -42,7 +42,7 @@ def app_logic(self, args: Namespace) -> None: if not alloc_requests: print(f"\033[91m\033[1mNo active allocation information found in accounting system for '{args.account}'!\n") print("Showing end date for most recently expired Resource Allocation Request:\033[0m") - alloc_requests = get_most_recent_expired_request(keystone_session, group_id) + alloc_requests = [get_most_recent_expired_request(keystone_session, group_id)] for request in alloc_requests: print(f"'{request['title']}' ends on {request['expire']} ") diff --git a/apps/crc_sus.py b/apps/crc_sus.py index 84f7cdb..c9ca9d3 100755 --- a/apps/crc_sus.py +++ b/apps/crc_sus.py @@ -67,7 +67,7 @@ def app_logic(self, args: Namespace) -> None: if not alloc_requests: print(f"\033[91m\033[1mNo active allocation information found in accounting system for '{args.account}'!\n") print("Showing end date for most recently expired Resource Allocation Request:\033[0m") - alloc_requests = get_most_recent_expired_request(keystone_session, group_id) + alloc_requests = [get_most_recent_expired_request(keystone_session, group_id)] per_cluster_totals = get_per_cluster_totals(keystone_session, alloc_requests, get_enabled_cluster_ids(keystone_session)) diff --git a/apps/crc_usage.py b/apps/crc_usage.py index e26e09c..4281497 100755 --- a/apps/crc_usage.py +++ b/apps/crc_usage.py @@ -107,7 +107,7 @@ def app_logic(self, args: Namespace) -> None: if not alloc_requests: print(f"\033[91m\033[1mNo active allocation information found in accounting system for '{args.account}'!\n") print("Showing usage information for most recently expired Resource Allocation Request: \033[0m") - alloc_requests = get_most_recent_expired_request(keystone_session, group_id) + alloc_requests = [get_most_recent_expired_request(keystone_session, group_id)] clusters = get_enabled_cluster_ids(keystone_session)