mirror of https://github.com/apache/cloudstack.git
put getConnection into try
This commit is contained in:
parent
bc23b47e7a
commit
bb56a5d840
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue