Skip to content

Commit 312d531

Browse files
K0zkaDaanHoogland
authored andcommitted
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 <laszlo.hornyak@gmail.com> Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com> This closes #93
1 parent fdf47a2 commit 312d531

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ public boolean processTimeout(long agentId, long seq) {
205205
parameters += " --guestNic=" + kvmGuestNic;
206206
parameters += " --hypervisor=" + cluster.getHypervisorType().toString().toLowerCase();
207207

208-
SSHCmdHelper.sshExecuteCmd(sshConnection, "cloudstack-setup-agent " + parameters, 3);
208+
if (!SSHCmdHelper.sshExecuteCmd(sshConnection,
209+
"cloudstack-setup-agent " + parameters, 3)) {
210+
s_logger.info("cloudstack agent setup command failed: "
211+
+ "cloudstack-setup-agent " + parameters);
212+
return null;
213+
}
209214

210215
KvmDummyResourceBase kvmResource = new KvmDummyResourceBase();
211216
Map<String, Object> params = new HashMap<String, Object>();

0 commit comments

Comments
 (0)