put getConnection into try

This commit is contained in:
anthony 2011-09-01 17:33:11 -07:00
parent bc23b47e7a
commit bb56a5d840
2 changed files with 2 additions and 2 deletions

View File

@ -277,8 +277,8 @@ public class XenServer56Resource extends CitrixResourceBase {
@Override
protected CheckOnHostAnswer execute(CheckOnHostCommand cmd) {
Connection conn = getConnection();
try {
Connection conn = getConnection();
String result = callHostPluginPremium(conn, "check_heartbeat", "host", cmd.getHost().getGuid(), "interval",
Integer.toString(_heartbeatInterval * 2));
if (result == null) {

View File

@ -57,7 +57,7 @@ public class XenServerInvestigator extends AdapterBase implements Investigator {
continue;
}
Answer answer = _agentMgr.easySend(neighbor.getId(), cmd);
if (answer != null) {
if (answer != null && answer.getResult()) {
CheckOnHostAnswer ans = (CheckOnHostAnswer)answer;
if (!ans.isDetermined()) {
s_logger.debug("Host " + neighbor + " couldn't determine the status of " + agent);