Skip to content

Commit 1144f52

Browse files
committed
Merge remote-tracking branch 'apache/4.19'
2 parents 3c9bc07 + b080215 commit 1144f52

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

utils/src/main/java/com/cloud/utils/script/Script.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,8 @@ public static String getExecutableAbsolutePath(String executable) {
661661
return executable;
662662
}
663663

664-
private static Script getScriptForCommandRun(String... command) {
665-
Script s = new Script(command[0], 0);
664+
private static Script getScriptForCommandRun(long timeout, String... command) {
665+
Script s = new Script(command[0], timeout);
666666
if (command.length > 1) {
667667
for (int i = 1; i < command.length; ++i) {
668668
s.add(command[i]);
@@ -671,12 +671,16 @@ private static Script getScriptForCommandRun(String... command) {
671671
return s;
672672
}
673673

674+
private static Script getScriptForCommandRun(String... command) {
675+
return getScriptForCommandRun(0, command);
676+
}
677+
674678
public static String executeCommand(String... command) {
675679
return runScript(getScriptForCommandRun(command));
676680
}
677681

678682
public static int executeCommandForExitValue(long timeout, String... command) {
679-
return runScriptForExitValue(getScriptForCommandRun(command));
683+
return runScriptForExitValue(getScriptForCommandRun(timeout, command));
680684
}
681685

682686
public static int executeCommandForExitValue(String... command) {

0 commit comments

Comments
 (0)