mirror of https://github.com/apache/cloudstack.git
bug 6521: for add host, return api response, even if the host is in disconnected state
status 6521: resolved fixed
This commit is contained in:
parent
7c51a661df
commit
310556ecf2
|
|
@ -124,6 +124,10 @@ public abstract class AgentAttache {
|
|||
_status = Status.Up;
|
||||
}
|
||||
|
||||
public boolean isReady() {
|
||||
return _status == Status.Up;
|
||||
}
|
||||
|
||||
public boolean isConnecting() {
|
||||
return _status == Status.Connecting;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -903,7 +903,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory {
|
|||
if (!monitor.second().processConnect(host, cmd[i])) {
|
||||
s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId);
|
||||
handleDisconnect(attache, Event.AgentDisconnected, false);
|
||||
return null;
|
||||
return attache;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1034,12 +1034,14 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory {
|
|||
resource.disconnected();
|
||||
return null;
|
||||
}
|
||||
|
||||
StartupAnswer[] answers = new StartupAnswer[cmds.length];
|
||||
for (int i = 0; i < answers.length; i++) {
|
||||
answers[i] = new StartupAnswer(cmds[i], attache.getId(), _pingInterval);
|
||||
if( attache.isReady()) {
|
||||
StartupAnswer[] answers = new StartupAnswer[cmds.length];
|
||||
for (int i = 0; i < answers.length; i++) {
|
||||
answers[i] = new StartupAnswer(cmds[i], attache.getId(), _pingInterval);
|
||||
}
|
||||
|
||||
attache.process(answers);
|
||||
}
|
||||
attache.process(answers);
|
||||
return attache;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue