Fix edit host fail in admin
@@ -231,7 +231,7 @@ class HostHandler(object):
logger.warning("No host found with id=" + id)
return {}
- if h_old.get("status") == "pending":
+ if h_old.status == "pending":
return {}
if "worker_api" in d and not d["worker_api"].startswith("tcp://"):
@@ -246,6 +246,10 @@ class HostHandler(object):
d["log_server"] = "udp://" + d["log_server"]
if "log_type" in d and d["log_type"] == CLUSTER_LOG_TYPES[0]:
d["log_server"] = ""
+ if "autofill" in d:
+ d["autofill"] = d["autofill"] == "true"
+ if "schedulable" in d:
+ d["schedulable"] = d["schedulable"] == "true"
self.db_set_by_id(id, **d)
h_new = self.get_by_id(id)
return self._schema(h_new)
