Skip to content

Commit

Permalink
refactor xdmod code to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Nov 8, 2023
1 parent c2261b3 commit fefffb4
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 364 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def handle(self, *args, **options):
# UBCCR defaults
('Cloud Account Name', 'Text', False, False),
# ('CLOUD_USAGE_NOTIFICATION', 'Yes/No', False, True),
('Core Usage (Hours)', 'Int', True, False),
('Core Usage (Hours)', 'Float', True, False),
# ('Accelerator Usage (Hours)', 'Int', True, False),
# ('Cloud Storage Quota (TB)', 'Float', True, False),
# ('EXPIRE NOTIFICATION', 'Yes/No', False, True),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,19 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
<span class="float-right">Last Synced {{user_sync_dt}}</span>
</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Quota (TB):</th>
<td id = "group_quota">{{ allocation.size|floatformat:2 }}</td>
</tr>
<tr>
<th style="background-color:#D3D3D3" bordercolor="red" scope="row" class="text-nowrap">Total Amount Due: </th>
{% cost_tb allocation.size as cost %}
{% if cost %}
<td style="background-color:#D3D3D3">{{ cost }}</td>
{% endif %}
</tr>
{% if "Storage" in allocation.get_parent_resource.resource_type.name %}
<tr>
<th scope="row" class="text-nowrap">Quota (TB):</th>
<td id = "group_quota">{{ allocation.size|floatformat:2 }}</td>
</tr>
<tr>
<th style="background-color:#D3D3D3" bordercolor="red" scope="row" class="text-nowrap">Total Amount Due: </th>
{% cost_tb allocation.size as cost %}
{% if cost %}
<td style="background-color:#D3D3D3">{{ cost }}</td>
{% endif %}
</tr>
{% endif %}
<tr>
<th scope="row" class="text-nowrap">Start Date:</th>
<td>
Expand Down
3 changes: 2 additions & 1 deletion coldfront/core/allocation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ def get_queryset(self):
# Allocation Attribute Name
if data.get('allocation_attribute_name') and data.get('allocation_attribute_value'):
allocations = allocations.filter(
Q(allocationattribute__allocation_attribute_type=data.get('allocation_attribute_name')) &
Q(allocationattribute__allocation_attribute_type=data.get(
'allocation_attribute_name')) &
Q(allocationattribute__value=data.get('allocation_attribute_value'))
)

Expand Down
6 changes: 4 additions & 2 deletions coldfront/plugins/slurm/management/commands/slurm_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ def add_arguments(self, parser):
parser.add_argument("-c", "--cluster",
help="Run sacctmgr dump [cluster] as input")
parser.add_argument("-s", "--sync",
help="Remove associations in Slurm that no longer exist in ColdFront", action="store_true")
help="Remove associations in Slurm that no longer exist in ColdFront",
action="store_true")
parser.add_argument("-n", "--noop",
help="Print commands only. Do not run any commands.", action="store_true")
help="Print commands only. Do not run any commands.",
action="store_true")
parser.add_argument("-u", "--username", help="Check specific username")
parser.add_argument("-a", "--account", help="Check specific account")
parser.add_argument("-x", "--header",
Expand Down
Loading

0 comments on commit fefffb4

Please sign in to comment.