cast memory attributes (originally float) to int
authorMaciej Tronowski <mtro@man.poznan.pl>
Fri, 11 Sep 2015 14:00:07 +0000 (16:00 +0200)
committerDawid Jagieła <lightnir@gmail.com>
Sat, 12 Sep 2015 10:26:20 +0000 (12:26 +0200)
qcg/utils.py

index da8f83c..57cf23a 100644 (file)
@@ -155,7 +155,7 @@ def to_form_data(xml):
     desc.xml_description = xml
 
     direct_map = ('env_variables', 'executable', 'arguments', 'note', 'grant', 'hosts', 'properties', 'queue', 'procs',
-                  'wall_time', 'memory', 'memory_per_slot', 'modules', 'input', 'stage_in', 'native', 'persistent')
+                  'wall_time', 'modules', 'input', 'stage_in', 'native', 'persistent')
 
     params = {}
     for name in direct_map:
@@ -193,6 +193,10 @@ def to_form_data(xml):
         else:
             params['postprocess_type'] = JobDescriptionForm.Process.CMD
             params['postprocess_cmd'] = desc.postprocess
+    if desc.memory:
+        params['memory'] = int(desc.memory)
+    if desc.memory_per_slot:
+        params['memory_per_slot'] = int(desc.memory_per_slot)
 
     return params