Cosmetic stc fixes.
Change-Id: I00fdc0135c22c4b3872fe31dcf7d786af005f035
diff --git a/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java b/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java
index 1da9545..1dcff28 100644
--- a/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java
+++ b/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java
@@ -23,7 +23,6 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
-import java.util.function.Function;
import static java.lang.String.format;
import static org.onlab.stc.Coordinator.Status.FAILED;
@@ -46,27 +45,25 @@
private Process process;
private StepProcessListener delegate;
- private Function<String, String> substitutor;
/**
* Creates a process monitor.
*
- * @param step step or group to be executed
- * @param logDir directory where step process log should be stored
- * @param delegate process lifecycle listener
- * @param substitutor function to substitute var reference in command
+ * @param step step or group to be executed
+ * @param logDir directory where step process log should be stored
+ * @param delegate process lifecycle listener
+ * @param command actual command to execute
*/
StepProcessor(Step step, File logDir, StepProcessListener delegate,
- Function<String, String> substitutor) {
+ String command) {
this.step = step;
this.logDir = logDir;
this.delegate = delegate;
- this.substitutor = substitutor;
+ this.command = command;
}
@Override
public void run() {
- command = substitutor != null ? substitutor.apply(command()) : command();
delegate.onStart(step, command);
int code = execute();
boolean ignoreCode = step.env() != null && step.env.equals(IGNORE_CODE);
@@ -81,7 +78,7 @@
*/
private int execute() {
try (PrintWriter pw = new PrintWriter(logFile())) {
- process = Runtime.getRuntime().exec(command);
+ process = Runtime.getRuntime().exec(command());
processOutput(pw);
// Wait for the process to complete and get its exit code.
@@ -107,7 +104,7 @@
return format("%s %s %s %s", launcher,
step.env() != null ? step.env() : "-",
step.cwd() != null ? step.cwd() : "-",
- step.command());
+ command);
}
/**