mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-4911 - [Mixed Hypervisor] VM Status is marked as alive when exit status of ping command is not available within command timeout
Currently during ssh execution of remote command, if no response is received within timeout, Cloudstack is returning success result. This is resulting in false positives. Fix is to check if exit status of remote command is available or not. If not, return failure result. Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
parent
90521a3e15
commit
748315620b
@ -185,6 +185,12 @@ public class SshHelper {
|
||||
}
|
||||
|
||||
String result = sbResult.toString();
|
||||
|
||||
if (sess.getExitStatus() == null) {
|
||||
//Exit status is NOT available. Returning failure result.
|
||||
return new Pair<Boolean, String>(false, result);
|
||||
}
|
||||
|
||||
if (sess.getExitStatus() != null && sess.getExitStatus().intValue() != 0) {
|
||||
s_logger.error("SSH execution of command " + command + " has an error status code in return. result output: " + result);
|
||||
return new Pair<Boolean, String>(false, result);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user