in gridengine/src/gridengine/driver.py [0:0]
def _default_get_host_template(self, node: Node) -> str:
complex_values: List[str] = []
for res_name, res_value in node.resources.items():
if isinstance(res_value, bool):
res_value = str(res_value).lower()
if isinstance(res_value, str) and res_value.lower() in ["true", "false"]:
if res_value.lower() == "true":
res_value = 1
else:
res_value = 0
if res_name not in self.ge_env.unfiltered_complexes:
logging.fine("Ignoring unknown complex %s", res_name)
continue
if not res_value:
logging.fine("Ignoring blank complex %s for %s", res_name, node)
continue
complex = self.ge_env.unfiltered_complexes[res_name]
if complex.complex_type in ["TIME"]:
logging.fine("Ignoring TIME complex %s for %s", res_name, node)
continue
if complex.name != complex.shortcut and res_name == complex.shortcut:
# this is just a duplicate of the long form
continue
complex_values.append("{}={}".format(res_name, res_value))
complex_values_csv = ",".join(complex_values)
base_template = """hostname {hostname}