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();
|
String result = sbResult.toString();
|
||||||
if (result != null && !result.isEmpty())
|
if (result != null && !result.isEmpty())
|
||||||
s_logger.debug(cmd + " output:" + result);
|
s_logger.debug(cmd + " output:" + result);
|
||||||
|
// exit status delivery might get delayed
|
||||||
return sshSession.getExitStatus();
|
for(int i = 0 ; i<10 ; i++ ) {
|
||||||
|
Integer status = sshSession.getExitStatus();
|
||||||
|
if( status != null ) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
Thread.sleep(100);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
s_logger.debug("Ssh executed failed", e);
|
s_logger.debug("Ssh executed failed", e);
|
||||||
throw new SshException("Ssh executed failed " + e.getMessage());
|
throw new SshException("Ssh executed failed " + e.getMessage());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user