Skip to content

Commit 7d6772f

Browse files
cmvcordovalebrice
andauthored
Change strip to rstrip to remove common lustre output chars (#166)
* change strip to rstrip to remove common lustre output chars * pre-commit check * ruff check * Remove surrounding spaces before stripping '*', 'G' and 'k' characters --------- Co-authored-by: Fabrice Normandin <[email protected]>
1 parent c75519f commit 7d6772f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

milatools/utils/disk_quota.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def _parse_lfs_quota_output(
9292
_grace_files,
9393
) = values_line_parts
9494

95-
used_gb = int(used_kbytes.strip()) / (1024**2)
96-
max_gb = int(limit_kbytes.strip()) / (1024**2)
95+
used_gb = int(used_kbytes.strip().rstrip("*Gk")) / (1024**2)
96+
max_gb = int(limit_kbytes.strip().rstrip("*Gk")) / (1024**2)
9797
used_files = int(files.strip())
9898
max_files = int(limit_files.strip())
9999
return (used_gb, max_gb), (used_files, max_files)

0 commit comments

Comments
 (0)