Updated Branches: refs/heads/3.0.x f109669a9 -> 95cc3c2a8
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. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/95cc3c2a Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/95cc3c2a Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/95cc3c2a Branch: refs/heads/3.0.x Commit: 95cc3c2a875f94a7b6ee893d2ef1566172da9e49 Parents: f109669 Author: Sheng Yang <[email protected]> Authored: Thu May 31 18:54:08 2012 -0700 Committer: Sheng Yang <[email protected]> Committed: Thu May 31 18:54:08 2012 -0700 ---------------------------------------------------------------------- .../router/VirtualNetworkApplianceManagerImpl.java | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95cc3c2a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index c85b3c7..d044d4f 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -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;
