Skip to content

Commit 97e4fbc

Browse files
author
Daan Hoogland
committed
Merge branch 'investigator_null_state_fix' of https://github.com/remibergsma/cloudstack
This closes apache#211
2 parents 1669bb9 + 78e095e commit 97e4fbc

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

server/src/com/cloud/ha/AbstractInvestigatorImpl.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected Status testIpAddress(Long hostId, String testHostIp) {
9292
if (s_logger.isDebugEnabled()) {
9393
s_logger.debug("host (" + testHostIp + ") returns null answer");
9494
}
95-
return null;
95+
return Status.Alert;
9696
}
9797

9898
if (pingTestAnswer.getResult()) {
@@ -103,14 +103,20 @@ protected Status testIpAddress(Long hostId, String testHostIp) {
103103
return Status.Up;
104104
} else {
105105
if (s_logger.isDebugEnabled()) {
106-
s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning null ('I don't know')");
106+
s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning Alert state");
107107
}
108-
return null;
108+
return Status.Alert;
109109
}
110110
} catch (AgentUnavailableException e) {
111-
return null;
111+
if (s_logger.isDebugEnabled()) {
112+
s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Disconnected state");
113+
}
114+
return Status.Disconnected;
112115
} catch (OperationTimedoutException e) {
113-
return null;
116+
if (s_logger.isDebugEnabled()) {
117+
s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Alert state");
118+
}
119+
return Status.Alert;
114120
}
115121
}
116122
}

0 commit comments

Comments
 (0)