mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-6662
CLOUDSTACK-6844 exit status delivery might get delayed Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
bc4be5272b
commit
ce3550f333
@ -155,8 +155,15 @@ public class SSHCmdHelper {
|
||||
String result = sbResult.toString();
|
||||
if (result != null && !result.isEmpty())
|
||||
s_logger.debug(cmd + " output:" + result);
|
||||
|
||||
return sshSession.getExitStatus();
|
||||
// exit status delivery might get delayed
|
||||
for(int i = 0 ; i<10 ; i++ ) {
|
||||
Integer status = sshSession.getExitStatus();
|
||||
if( status != null ) {
|
||||
return status;
|
||||
}
|
||||
Thread.sleep(100);
|
||||
}
|
||||
return -1;
|
||||
} catch (Exception e) {
|
||||
s_logger.debug("Ssh executed failed", e);
|
||||
throw new SshException("Ssh executed failed " + e.getMessage());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user