Fix the bug:

Remove host when the host is in disconnected state, then you will fail to add the same host back.
This commit is contained in:
edison 2010-09-01 11:17:06 -07:00
parent 18956dc3c2
commit 8c5268d72d
1 changed files with 3 additions and 2 deletions

View File

@ -535,11 +535,12 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory {
_dcDao.releasePrivateIpAddress(host.getPrivateIpAddress(), host.getDataCenterId(), null);
AgentAttache attache = _agents.get(hostId);
handleDisconnect(attache, Status.Event.Remove, false);
/*
/*Disconnected agent needs special handling here*/
host.setGuid(null);
host.setClusterId(null);
_hostDao.update(host.getId(), host);
*/
_hostDao.remove(hostId);
//delete the associated primary storage from db