only send command to host which is UP

This commit is contained in:
anthony 2010-10-14 10:24:41 -07:00
parent 146def1ded
commit 9b839d749b
1 changed files with 4 additions and 0 deletions

View File

@ -1318,6 +1318,10 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory {
@Override
public Answer easySend(final Long hostId, final Command cmd, int timeout) {
try {
Host h = _hostDao.findById(hostId);
if( !h.getStatus().equals(Status.Up) ) {
return null;
}
final Answer answer = send(hostId, cmd, timeout);
if (answer == null) {
s_logger.warn("send returns null answer");