mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 9154: Add router fault state report
This commit is contained in:
parent
07a61686db
commit
6f0edd9541
@ -32,7 +32,8 @@ public interface VirtualRouter extends VirtualMachine {
|
||||
public enum RedundantState {
|
||||
UNKNOWN,
|
||||
MASTER,
|
||||
BACKUP
|
||||
BACKUP,
|
||||
FAULT
|
||||
}
|
||||
RedundantState getRedundantState();
|
||||
}
|
||||
|
||||
@ -364,11 +364,10 @@ public class VirtualRoutingResource implements Manager {
|
||||
final String routerPrivateIPAddress = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
|
||||
|
||||
final String result = getRouterStatus(routerPrivateIPAddress);
|
||||
CheckRouterAnswer answer = new CheckRouterAnswer(cmd, false, "Router return: " + result);
|
||||
if (result != null) {
|
||||
answer.setIsMaster(result.equals("Status: MASTER"));
|
||||
if (result == null || result.isEmpty()) {
|
||||
return new CheckRouterAnswer(cmd, "CheckRouterCommand failed");
|
||||
}
|
||||
return answer;
|
||||
return new CheckRouterAnswer(cmd, result.equals("Status: MASTER"), result);
|
||||
}
|
||||
|
||||
protected Answer execute(final CheckConsoleProxyLoadCommand cmd) {
|
||||
|
||||
@ -734,7 +734,11 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
if (answer.getIsMaster()) {
|
||||
router.setRedundantState(RedundantState.MASTER);
|
||||
} else {
|
||||
router.setRedundantState(RedundantState.BACKUP);
|
||||
if (answer.getDetails() != null && answer.getDetails().equals("Status: BACKUP")) {
|
||||
router.setRedundantState(RedundantState.BACKUP);
|
||||
} else {
|
||||
router.setRedundantState(RedundantState.FAULT);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
router.setRedundantState(RedundantState.UNKNOWN);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user