CS-15116: When GetDomRVersion failed, let VR creation fail

Because there are more commands after GetDomRVersion command. Though
GetDomRVersion command itself is not that critical, the commands after it may
including DHCP and firewall related commands. The failure of GetDomRVersion
command would result in the following commands fail to be executed. So it should
fail, and fail loudly.
This commit is contained in:
Sheng Yang 2012-05-31 18:54:08 -07:00
parent 2caed96c3a
commit 0b730969ef
1 changed files with 5 additions and 3 deletions

View File

@ -1936,19 +1936,21 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
result = false;
}
if (result == false) {
return false;
return result;
}
answer = cmds.getAnswer("getDomRVersion");
if (answer != null && answer instanceof GetDomRVersionAnswer) {
GetDomRVersionAnswer versionAnswer = (GetDomRVersionAnswer)answer;
if (answer == null || !answer.getResult()) {
/* Try to push on because it's not a critical error */
s_logger.warn("Unable to get the template/scripts version of router " + router.getInstanceName() + " due to: " + versionAnswer.getDetails() + ", but we would continue");
s_logger.warn("Unable to get the template/scripts version of router " + router.getInstanceName() + " due to: " + versionAnswer.getDetails());
result = false;
} else {
router.setTemplateVersion(versionAnswer.getTemplateVersion());
router.setScriptsVersion(versionAnswer.getScriptsVersion());
router = _routerDao.persist(router);
}
} else {
result = false;
}
return result;