diff options
author | Andreas Eriksen <andreer@pvv.ntnu.no> | 2020-03-26 09:48:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 09:48:49 +0100 |
commit | 89d4cc75bc59495b48ba07ab67c2959b3f2c7e4e (patch) | |
tree | 2ed07470803cc10122beb44ac44b49b80de5bd46 /node-admin | |
parent | 63c270f3a94815aa420bd069c5a8760798103f25 (diff) |
Revert "Revert "fix provisioning race condition""
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/Yum.java | 18 |
1 files changed, 9 insertions, 9 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 a4138b215c4..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 @@ -69,7 +69,7 @@ public class Yum { * * @return false only if the package was already locked and installed at the given version (no-op) */ - public boolean installFixedVersion(TaskContext context, YumPackageName yumPackage) { + public boolean installFixedVersion(TaskContext context, YumPackageName yumPackage, String... repos) { String targetVersionLockName = yumPackage.toVersionLockName(); boolean alreadyLocked = terminal @@ -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", "--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; } |