do not propogate password changes if Attache is ConnectedAgentattache

This commit is contained in:
Abhinandan Prateek 2011-05-16 18:32:13 +05:30 committed by root
parent 5769fde46b
commit 9de370be61
2 changed files with 12 additions and 0 deletions

View File

@ -721,6 +721,9 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
if (upasscmd.getClusterId() == null) {
//update agent attache password
AgentAttache agent = this.findAttache(upasscmd.getHostId());
if (!(agent instanceof DirectAgentAttache)) {
return false;
}
UpdateHostPasswordCommand cmd = new UpdateHostPasswordCommand(upasscmd.getUsername(), upasscmd.getPassword());
agent.updatePassword(cmd);
}
@ -729,6 +732,9 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
List<HostVO> hosts = _hostDao.listByCluster(upasscmd.getClusterId());
for (HostVO h : hosts) {
AgentAttache agent = this.findAttache(h.getId());
if (!(agent instanceof DirectAgentAttache)) {
continue;
}
UpdateHostPasswordCommand cmd = new UpdateHostPasswordCommand(upasscmd.getUsername(), upasscmd.getPassword());
agent.updatePassword(cmd);
}

View File

@ -325,6 +325,9 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
//update agent attache password
try {
Boolean result = _clusterMgr.propagateAgentEvent(upasscmd.getHostId(), Event.UpdatePassword);
if (result != null) {
return result;
}
} catch (AgentUnavailableException e) {
}
}
@ -334,6 +337,9 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
for (HostVO h : hosts) {
try {
Boolean result = _clusterMgr.propagateAgentEvent(h.getId(), Event.UpdatePassword);
if (result != null) {
return result;
}
} catch (AgentUnavailableException e) {
}
}