Skip to content

Commit

Permalink
Merge remote-tracking branch 'apache/4.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
shwstppr committed Jul 8, 2024
2 parents 3c9bc07 + b080215 commit 1144f52
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions utils/src/main/java/com/cloud/utils/script/Script.java
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ public static String getExecutableAbsolutePath(String executable) {
return executable;
}

private static Script getScriptForCommandRun(String... command) {
Script s = new Script(command[0], 0);
private static Script getScriptForCommandRun(long timeout, String... command) {
Script s = new Script(command[0], timeout);
if (command.length > 1) {
for (int i = 1; i < command.length; ++i) {
s.add(command[i]);
Expand All @@ -671,12 +671,16 @@ private static Script getScriptForCommandRun(String... command) {
return s;
}

private static Script getScriptForCommandRun(String... command) {
return getScriptForCommandRun(0, command);
}

public static String executeCommand(String... command) {
return runScript(getScriptForCommandRun(command));
}

public static int executeCommandForExitValue(long timeout, String... command) {
return runScriptForExitValue(getScriptForCommandRun(command));
return runScriptForExitValue(getScriptForCommandRun(timeout, command));
}

public static int executeCommandForExitValue(String... command) {
Expand Down

0 comments on commit 1144f52

Please sign in to comment.