mirror of https://github.com/apache/cloudstack.git
Fix wrong usage of SearchCriteria2 in AgentMonitor
This commit is contained in:
parent
cdd94c1b9a
commit
275a5ffa3c
|
|
@ -141,10 +141,11 @@ public class AgentMonitor extends Thread implements Listener {
|
|||
try {
|
||||
List<Long> behindAgents = findAgentsBehindOnPing();
|
||||
for (Long agentId : behindAgents) {
|
||||
SearchCriteriaService<HostVO, ResourceState> sc = SearchCriteria2.create(HostVO.class, ResourceState.class);
|
||||
SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
|
||||
sc.selectField(sc.getEntity().getResourceState());
|
||||
sc.addAnd(sc.getEntity().getId(), Op.EQ, agentId);
|
||||
ResourceState resourceState = sc.find();
|
||||
HostVO h = sc.find();
|
||||
ResourceState resourceState = h.getResourceState();
|
||||
if (resourceState == ResourceState.Disabled || resourceState == ResourceState.Maintenance || resourceState == ResourceState.Unmanaged || resourceState == ResourceState.ErrorInMaintenance) {
|
||||
/* Host is in non-operation state, so no investigation and direct put agent to Disconnected */
|
||||
status_Logger.debug("Ping timeout but host " + agentId + " is in resource state of " + resourceState + ", so no investigation");
|
||||
|
|
|
|||
Loading…
Reference in New Issue