From bcf9be2666b2e32f02d1c2c96d63570b22a3f12e Mon Sep 17 00:00:00 2001 From: James Corbett Date: Fri, 30 Aug 2024 22:30:44 -0700 Subject: [PATCH] dws: improve error message Problem: the error message for requesting too much lustre storage gives a float, but an integer would be better and more consistent with the other file system types. Provide an integer in the error message by doing integer division instead of normal float division. --- src/python/flux_k8s/directivebreakdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/flux_k8s/directivebreakdown.py b/src/python/flux_k8s/directivebreakdown.py index 1df2991..207284d 100644 --- a/src/python/flux_k8s/directivebreakdown.py +++ b/src/python/flux_k8s/directivebreakdown.py @@ -46,7 +46,7 @@ def validate(self, nodecount): requested = getattr(self, attr) allowable = getattr(type(self), attr) if attr == "lustre": - requested = requested / nodecount + requested = requested // nodecount if allowable is not None and requested > allowable: raise ValueError( f"Requested a total of {requested} GiB of {attr} storage "