diff options
author | Håkon Hallingstad <hakon@oath.com> | 2018-02-06 10:39:15 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@oath.com> | 2018-02-06 10:39:15 +0100 |
commit | 9659e44703735cf7b7e6e0b772838e0a16721e3d (patch) | |
tree | f43cea4320a7e91c5e1f9f7b87ab7e3d15352a27 | |
parent | ab8ab90906349ee281ddb4ec9bb1056e87f2a579 (diff) |
Make TerminalImpl implement Terminal and remove outcommented code
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TerminalImpl.java | 8 | ||||
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/Yum.java | 15 |
2 files changed, 7 insertions, 16 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TerminalImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TerminalImpl.java index 93c1055fc58..422584b8ccd 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TerminalImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TerminalImpl.java @@ -1,14 +1,20 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.node.admin.task.util.process; +import com.yahoo.jdisc.Timer; import com.yahoo.vespa.hosted.node.admin.component.TaskContext; /** * @author hakonhall */ -public class TerminalImpl { +public class TerminalImpl implements Terminal { private final ProcessFactory processFactory; + public TerminalImpl(Timer timer) { + this(new ProcessFactoryImpl(new ProcessStarterImpl(), timer)); + } + + /** For testing. */ public TerminalImpl(ProcessFactory processFactory) { this.processFactory = processFactory; } diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/Yum.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/Yum.java index 188de5a2f17..dbb4c909a4b 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/Yum.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/Yum.java @@ -88,21 +88,6 @@ public class Yum { } public boolean converge() { -// Terminal terminal; -// CommandLine commandLine = terminal.newCommandLine(taskContext); -// commandLine.add("yum", yumCommand, "--assumeyes"); -// enabledRepo.ifPresent(repo -> commandLine.add("--enablerepo=" + repo)); -// commandLine.add(packages); -// CommandResult result = commandLine.executeSilently(); -// -// String output = result.getUntrimmedOutput(); -// if (commandOutputNoopPattern.matcher(output).find()) { -// return false; -// } else { -// commandLine.recordSilentExecutionAsSystemModification(); -// return true; -// } - Command command = commandSupplier.get(); command.add("yum", yumCommand, "--assumeyes"); enabledRepo.ifPresent(repo -> command.add("--enablerepo=" + repo)); |