[ARVADOS] updated: dbd91c317d54da7123bee4f2d496b440b2ba9393

Git user git at public.curoverse.com
Fri May 26 15:14:30 EDT 2017


Summary of changes:
 services/nodemanager/arvnodeman/jobqueue.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

       via  dbd91c317d54da7123bee4f2d496b440b2ba9393 (commit)
      from  d0811968704eb02e3e98e46345fadf22cf95b5ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit dbd91c317d54da7123bee4f2d496b440b2ba9393
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri May 26 15:14:12 2017 -0400

    11767: Recognize lowercase suffixes, just in case future versions of slurm
    change the format again.

diff --git a/services/nodemanager/arvnodeman/jobqueue.py b/services/nodemanager/arvnodeman/jobqueue.py
index cf23df0..27e769b 100644
--- a/services/nodemanager/arvnodeman/jobqueue.py
+++ b/services/nodemanager/arvnodeman/jobqueue.py
@@ -119,14 +119,15 @@ class JobQueueMonitorActor(clientactor.RemotePollLoopActor):
 
     @staticmethod
     def coerce_to_mb(x):
-        if x.endswith("M"):
-            return int(x[:-1])
-        elif x.endswith("G"):
-            return int(x[:-1]) * 2**10
-        elif x.endswith("T"):
-            return int(x[:-1]) * 2**20
-        elif x.endswith("P"):
-            return int(x[:-1]) * 2**30
+        v, u = x[:-1], x[-1]
+        if u in ("M", "m"):
+            return int(v)
+        elif u in ("G", "g"):
+            return int(v) * 2**10
+        elif u in ("T", "t"):
+            return int(v) * 2**20
+        elif u in ("P", "p"):
+            return int(v) * 2**30
         else:
             return int(x)
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list