Skip to content

Commit

Permalink
Fixing for Codacy to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinkhalifa committed Aug 22, 2024
1 parent b0847ae commit a760fb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/crc_idle.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _count_idle_cpu_resources(cluster: str, partition: str) -> dict[int, dict[st
# Count the number of nodes having a given number of idle cores/GPUs
return_dict = dict()
for node_info in slurm_data:
node_name, resource_data, free_mem = node_info.split(',')
_, resource_data, free_mem = node_info.split(',')
allocated, idle, other, total = [int(x) for x in resource_data.split('/')]
if idle not in return_dict:
# Initialize a new entry for this idle count
Expand Down Expand Up @@ -116,7 +116,7 @@ def _count_idle_gpu_resources(cluster: str, partition: str) -> dict[int, dict[st
# Count the number of nodes having a given number of idle cores/GPUs
return_dict = dict()
for node_info in slurm_data:
node_name, total, allocated, state, free_mem = node_info.split('_')
_, total, allocated, state, free_mem = node_info.split('_')

# If the node is in a downed state, report 0 resource availability.
if re.search("drain", state):
Expand Down

0 comments on commit a760fb3

Please sign in to comment.