Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Answer execute(final CheckOnHostCommand command, final LibvirtComputingRe
if (hasHeartBeat) {
return new CheckOnHostAnswer(command, true, "Heart is beating");
} else {
return new CheckOnHostAnswer(command, "Heart is not beating");
return new CheckOnHostAnswer(command, false, "Heart is not beating");
}
} catch (final InterruptedException e) {
return new CheckOnHostAnswer(command, "CheckOnHostCommand: can't get status of host: InterruptedException");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public Status getHostAgentStatus(Host host) {
}

Status hostStatusFromNeighbour = checkHostStatusWithNeighbourHosts(host);
logger.debug("{} status reported from itself: {} and neighbor: {}", host.toString(), hostStatusFromItself, hostStatusFromNeighbour);
Status hostStatus = hostStatusFromItself;
if (hostStatusFromNeighbour == Status.Up && (hostStatusFromItself == Status.Disconnected || hostStatusFromItself == Status.Down)) {
hostStatus = Status.Disconnected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import com.cloud.agent.api.CheckOnHostAnswer;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

Expand Down Expand Up @@ -3130,7 +3131,9 @@ public void testCheckOnHostCommand() {
assertNotNull(wrapper);

final Answer answer = wrapper.execute(command, libvirtComputingResourceMock);
assertFalse(answer.getResult());
assertTrue(answer.getResult());
assertTrue(answer instanceof CheckOnHostAnswer);
assertFalse(((CheckOnHostAnswer)answer).isAlive());

verify(libvirtComputingResourceMock, times(1)).getMonitor();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5807,7 +5807,7 @@ protected Answer execute(PingTestCommand cmd) {
}

protected Answer execute(CheckOnHostCommand cmd) {
return new CheckOnHostAnswer(cmd, null, "Not Implmeneted");
return new CheckOnHostAnswer(cmd, null, "Not Implemented");
}

protected Answer execute(ModifySshKeysCommand cmd) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public final class CitrixCheckOnHostCommandWrapper extends CommandWrapper<CheckO

@Override
public Answer execute(final CheckOnHostCommand command, final CitrixResourceBase citrixResourceBase) {
return new CheckOnHostAnswer(command, "Not Implmeneted");
return new CheckOnHostAnswer(command, "Not Implemented");
}
}
Loading