Skip to content

Commit

Permalink
Update crc_proposal_end.py
Browse files Browse the repository at this point in the history
Updated requests with group_id
  • Loading branch information
chnixi authored May 7, 2024
1 parent 0e9d763 commit 098e9e9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion apps/crc_proposal_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,18 @@ def app_logic(self, args: Namespace) -> None:
{'username': os.environ["USER"],
'password': getpass("Please enter your CRC login password:\n")})

Check failure on line 40 in apps/crc_proposal_end.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

apps/crc_proposal_end.py#L40

Undefined variable 'getpass'

requests = get_allocation_requests(KEYSTONE_URL, auth_header)
accessible_research_groups = get_researchgroups(KEYSTONE_URL, auth_header)
keystone_group_id = None
for group in accessible_research_groups:
if args.account == group['name']:
keystone_group_id = int(group['id'])

if not keystone_group_id:
print(f"No allocation data found in accounting system for '{args.account}'")
exit()

requests = get_allocation_requests(KEYSTONE_URL, keystone_group_id, auth_header)

Check failure on line 52 in apps/crc_proposal_end.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

apps/crc_proposal_end.py#L52

Too many positional arguments for function call

Check warning on line 52 in apps/crc_proposal_end.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

apps/crc_proposal_end.py#L52

Unused variable 'requests'

Check notice on line 53 in apps/crc_proposal_end.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

apps/crc_proposal_end.py#L53

Trailing whitespace
# Requests have the following format:
# {'id': 33241, 'title': 'Resource Allocation Request for hban', 'description': 'Migration from CRC Bank',
# 'submitted': '2024-04-30', 'status': 'AP', 'active': '2024-04-05', 'expire': '2024-04-30', 'group': 1293}
Expand Down

0 comments on commit 098e9e9

Please sign in to comment.