Bether list output
This commit is contained in:
parent
c2bff00c16
commit
93bc1ca475
@ -128,11 +128,20 @@ elif (sys.argv[1] == "list"):
|
||||
|
||||
if (sys.argv[2] == "res"):
|
||||
res = json.loads(tryReadFile("/etc/slurm-llnl/localRes", "[]"))
|
||||
print(res)
|
||||
print(",".join(res["res"]))
|
||||
|
||||
if (sys.argv[2] == "nodes"):
|
||||
nodes = loadHosts()
|
||||
print(nodes)
|
||||
|
||||
print("NAME MASTER IP MAC CPUs RAM[GB] VERSION GRES")
|
||||
print("SELF")
|
||||
|
||||
for node in nodes.values():
|
||||
isMaster = ""
|
||||
if node["type"] == "master":
|
||||
isMaster = "YES"
|
||||
|
||||
print(f'{node["name"]: <8}{isMaster: <10}{node["ip"]: <18}{node["mac"]: <19}{node["cpus"]: <8}{node["rams"]: <11}{node["version"]: <11}{",".join(node["res"])}')
|
||||
|
||||
elif (sys.argv[1] == "get"):
|
||||
if (argc != 3):
|
||||
|
Loading…
x
Reference in New Issue
Block a user