in gridengine/src/gridengine/driver.py [0:0]
def add_exec_host(self, node: Node) -> None:
if not node.resources.get("ccnodeid"):
return
tempp = tempfile.mktemp()
try:
host_template = self.get_host_template(node)
logging.getLogger("gridengine.driver").info(
"host template contents written to %s", tempp
)
logging.getLogger("gridengine.driver").info(host_template)
with open(tempp, "w") as tempf:
tempf.write(host_template)
try:
self.ge_env.qbin.qconf(["-Ae", tempp])
except CalledProcessError as e:
if "already exists" in e.stdout.decode():
self.ge_env.qbin.qconf(["-Me", tempp])
else:
raise
finally:
if os.path.exists(tempp):
try:
os.remove(tempp)
except Exception:
pass
self.ge_env.qbin.qconf(["-as", node.hostname])
self.ge_env.qbin.qconf(["-ah", node.hostname])