Skip to content

Commit

Permalink
[CE-219] Fix host clean operation in admin dashboard
Browse files Browse the repository at this point in the history
Can clean host in admin dashboard

Change-Id: I3b66f5bfc0a2352d8e61c8e760c18dc3bc55d25e
Signed-off-by: Haitao Yue <hightall@me.com>
  • Loading branch information
hightall committed Jan 10, 2018
1 parent 42cb9d4 commit 95a691e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,19 +382,19 @@ def clean(self, id):
if len(clusters) <= 0:
return True

host = self.db_set_by_id(id, autofill=False)
host = self.db_set_by_id(id, **{"autofill": False})
schedulable_status = host.schedulable
if schedulable_status:
host = self.db_set_by_id(id, schedulable=False)
host = self.db_set_by_id(id, **{"schedulable": False})

for cluster_item in clusters:
cid = str(cluster_item.id)
t = Thread(target=cluster_item.cluster_handler.delete, args=(cid,))
t = Thread(target=cluster.cluster_handler.delete, args=(cid,))
t.start()
time.sleep(0.2)

if schedulable_status:
self.db_set_by_id(id, schedulable=schedulable_status)
self.db_set_by_id(id, **{"schedulable": schedulable_status})

return True

Expand Down

0 comments on commit 95a691e

Please sign in to comment.