Skip to content

Commit

Permalink
[CE-234] Fix edit host fail in admin
Browse files Browse the repository at this point in the history
Change-Id: I4fc6e73ab1b3c730dd5f386dfa1dd9e4401267d7
Signed-off-by: Haitao Yue <hightall@me.com>
  • Loading branch information
hightall committed Jan 17, 2018
1 parent 5e53579 commit ebcbfe6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def update(self, id, d):
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://"):
Expand All @@ -246,6 +246,10 @@ def update(self, id, d):
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)
Expand Down

0 comments on commit ebcbfe6

Please sign in to comment.