diff options
author | andreer <andreer@verizonmedia.com> | 2020-03-25 13:49:28 +0100 |
---|---|---|
committer | andreer <andreer@verizonmedia.com> | 2020-03-25 13:49:28 +0100 |
commit | d6dc88730c1e0db1b96693a62aa1896b15731b2f (patch) | |
tree | 593ca85a19ff582e6ed6d924edb3b1994b258e03 /node-admin | |
parent | e9700735654a7e038c828a27934ed501fbe575e0 (diff) |
also add repos to upgrade command
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/Yum.java | 16 |
1 files changed, 8 insertions, 8 deletions
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 37a2191a6e7..5f7fbdd0d69 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 @@ -118,25 +118,25 @@ public class Yum { // - "Nothing to do" // And in case we need to downgrade and return true from converge() - CommandLine commandLine = terminal.newCommandLine(context).add("yum", "install"); - for (String repo : repos) commandLine.add("--enablerepo=", repo); - commandLine.add("--assumeyes", yumPackage.toName()); + var installCommand = terminal.newCommandLine(context).add("yum", "install"); + for (String repo : repos) installCommand.add("--enablerepo=" + repo); + installCommand.add("--assumeyes", yumPackage.toName()); - String output = commandLine.executeSilently().getUntrimmedOutput(); + String output = installCommand.executeSilently().getUntrimmedOutput(); if (NOTHING_TO_DO_PATTERN.matcher(output).find()) { if (CHECKING_FOR_UPDATE_PATTERN.matcher(output).find()) { // case 3. - terminal.newCommandLine(context) - .add("yum", "downgrade", "--assumeyes", yumPackage.toName()) - .execute(); + var upgradeCommand = terminal.newCommandLine(context).add("yum", "downgrade", "--assumeyes"); + for (String repo : repos) upgradeCommand.add("--enablerepo=" + repo); + upgradeCommand.add(yumPackage.toName()).execute(); modified = true; } else { // case 2. } } else { // case 1. - commandLine.recordSilentExecutionAsSystemModification(); + installCommand.recordSilentExecutionAsSystemModification(); modified = true; } |