Merge pull request #1073 from ustcweizhou/CLOUDSTACK-9055

CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networksThis issue happened when the KVM nodes is down.It might also happen when the cloudstack-agent is killed unexpectedly.

* pr/1073:
  CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networks

Signed-off-by: Remi Bergsma <github@remi.nl>
This commit is contained in:
Remi Bergsma 2015-11-20 20:49:31 +01:00
commit 238c483a7c
1 changed files with 6 additions and 4 deletions

View File

@ -1013,10 +1013,12 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
s_logger.warn("Unable to update router " + router.getHostName() + "'s status");
}
RedundantState state = RedundantState.UNKNOWN;
if (answer != null && answer.getResult()) {
state = answer.getState();
} else {
s_logger.info("Agent response doesn't seem to be correct ==> " + answer.getResult());
if (answer != null) {
if (answer.getResult()) {
state = answer.getState();
} else {
s_logger.info("Agent response doesn't seem to be correct ==> " + answer.getResult());
}
}
router.setRedundantState(state);
updated = true;