Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat expired requests as list to fix indexing error #263

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/crc_proposal_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']} ")
4 changes: 2 additions & 2 deletions apps/crc_sus.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

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)
print("Showing remaining service unit amounts for most recently expired Resource Allocation Request:\033[0m")

Check notice on line 69 in apps/crc_sus.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

apps/crc_sus.py#L69

Line too long (121/120)
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))
Expand Down
2 changes: 1 addition & 1 deletion apps/crc_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down