Skip to content
Snippets Groups Projects
Commit 2f3bd739 authored by Alex Wiens's avatar Alex Wiens
Browse files

Prule: Fix some bugs

parent aaf7c677
Branches
Tags
No related merge requests found
......@@ -377,6 +377,8 @@ def parse_slurminfo(info):
slurm["StdOut"] = l[10:].strip("\n")
elif l.startswith(" StdIn="):
slurm["StdIn"] = l[9:].strip("\n")
elif l.startswith(" Reservation="):
slurm["StdIn"] = l[15:].strip("\n")
else:
for t in l.strip().split(" "):
k,v = t.split("=")
......@@ -390,15 +392,15 @@ def parse_slurminfo(info):
def parse_slurm_size(size):
num = 0
if size.endswith("K"):
num = int(size[:-1]) * 1024
num = float(size[:-1]) * 1024
elif size.endswith("M"):
num = int(size[:-1]) * 1024 * 1024
num = float(size[:-1]) * 1024 * 1024
elif size.endswith("G"):
num = int(size[:-1]) * 1024 * 1024 * 1024
num = float(size[:-1]) * 1024 * 1024 * 1024
elif size.endswith("T"):
num = int(size[:-1]) * 1024 * 1024 * 1024 * 1024
num = float(size[:-1]) * 1024 * 1024 * 1024 * 1024
else: # default is MiB
num = int(size) * 1024 * 1024
num = float(size) * 1024 * 1024
return num
# Prepare variables available for rule evaluation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment