Merge branch 'investigator_null_state_fix' of https://github.com/remibergsma/cloudstack

This closes #211
This commit is contained in:
Daan Hoogland 2015-04-29 15:00:00 +02:00
commit 97e4fbc294

View File

@ -92,7 +92,7 @@ public abstract class AbstractInvestigatorImpl extends AdapterBase implements In
if (s_logger.isDebugEnabled()) { if (s_logger.isDebugEnabled()) {
s_logger.debug("host (" + testHostIp + ") returns null answer"); s_logger.debug("host (" + testHostIp + ") returns null answer");
} }
return null; return Status.Alert;
} }
if (pingTestAnswer.getResult()) { if (pingTestAnswer.getResult()) {
@ -103,14 +103,20 @@ public abstract class AbstractInvestigatorImpl extends AdapterBase implements In
return Status.Up; return Status.Up;
} else { } else {
if (s_logger.isDebugEnabled()) { if (s_logger.isDebugEnabled()) {
s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning null ('I don't know')"); s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning Alert state");
} }
return null; return Status.Alert;
} }
} catch (AgentUnavailableException e) { } catch (AgentUnavailableException e) {
return null; if (s_logger.isDebugEnabled()) {
s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Disconnected state");
}
return Status.Disconnected;
} catch (OperationTimedoutException e) { } catch (OperationTimedoutException e) {
return null; if (s_logger.isDebugEnabled()) {
s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Alert state");
}
return Status.Alert;
} }
} }
} }