kvm: Check the return value of the cloudstack-setup-agent command Bug-Url: https://issues.apache.org/jira/browse/CLOUDSTACK-8016 Signed-off-by: Laszlo Hornyak <[email protected]> Signed-off-by: Rajani Karuturi <[email protected]>
This closes #93 (cherry picked from commit 7c1590ffd67b74f52fe374b0fb91f8c1ef731c39) Signed-off-by: Rohit Yadav <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c8e6fbb8 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c8e6fbb8 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c8e6fbb8 Branch: refs/heads/4.5 Commit: c8e6fbb8129818d980e06560e136e96a0111efd9 Parents: dd6bcde Author: Laszlo Hornyak <[email protected]> Authored: Sat Jan 17 22:09:16 2015 +0100 Committer: Rohit Yadav <[email protected]> Committed: Wed Mar 4 16:56:48 2015 +0530 ---------------------------------------------------------------------- .../hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8e6fbb8/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java index d475f4d..350b9a7 100644 --- a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java +++ b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java @@ -205,7 +205,12 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements parameters += " --guestNic=" + kvmGuestNic; parameters += " --hypervisor=" + cluster.getHypervisorType().toString().toLowerCase(); - SSHCmdHelper.sshExecuteCmd(sshConnection, "cloudstack-setup-agent " + parameters, 3); + if (!SSHCmdHelper.sshExecuteCmd(sshConnection, + "cloudstack-setup-agent " + parameters, 3)) { + s_logger.info("cloudstack agent setup command failed: " + + "cloudstack-setup-agent " + parameters); + return null; + } KvmDummyResourceBase kvmResource = new KvmDummyResourceBase(); Map<String, Object> params = new HashMap<String, Object>();
