in gridengine/src/gridengine/cli.py [0:0]
def queues(config: Dict) -> None:
ge_env = environment.from_qconf(config)
schedulers = ge_env.qbin.qconf(["-sss"]).split()
rows: List[List[str]] = []
for qname, ge_queue in ge_env.queues.items():
for hgrp in ge_queue.hostlist_groups:
fqdns = ge_env.qbin.qconf(["-shgrp", hgrp]).splitlines()
for line in fqdns:
line = line.strip()
if not line:
continue
if line.startswith("group_name"):
continue
# trim this out
if line.startswith("hostlist "):
line = line[len("hostlist ") :] # noqa: E203
for fqdn_expr in line.split():
fqdn_expr = fqdn_expr.strip()
if not fqdn_expr or fqdn_expr == "\\":
continue
host = fqdn_expr.split(".")[0]
if host in schedulers:
continue
rows.append([qname, hgrp, host])
demandprinter.print_rows(
columns=["QNAME", "HOSTGROUP", "HOSTNAME"],
rows=rows,
stream=sys.stdout,
output_format="table",
)