mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
13.13.2008 a33ae8f65570d219488ba1d0d46501c6a20d1fd5
Fix for issue 3355 (upgrade command should ask for confirmation)
Ask for the confirmation and fix a typo in a comment.
4 files modified
40 ■■■■ changed files
opends/src/messages/messages/quicksetup.properties 3 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java 18 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractorCliHelper.java 17 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java 2 ●●● patch | view | raw | blame | history
opends/src/messages/messages/quicksetup.properties
@@ -1248,6 +1248,9 @@
INFO_UPGRADE_VERIFICATION_FAILURE_PROMPT=The upgraded server returned errors \
 on startup.  Would you like to cancel the upgrade?  If you cancel, any \
 changes made to the server by this upgrade will be backed out.
INFO_UPGRADE_CONFIRM_TITLE=Confirm Upgrade
INFO_UPGRADE_CONFIRM_PROMPT=This installation will be upgraded using the zip \
 file %s.
INFO_UPGRADE_VERIFICATION_FAILURE_TITLE=Upgrade Verification Failed
INFO_UPGRADE_VERIFICATION_FAILURE_VIEW_DETAILS=View Error Details
INFO_UPGRADE_WELCOME_PANEL_TITLE=Welcome
opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java
@@ -202,14 +202,18 @@
            new BuildExtractorCliHelper((UpgradeLauncher)launcher);
    UpgradeUserData uud = helper.createUserData(args);
    // Build Extractor is always quiet
    uud.setQuiet(true);
    if (uud != null)
    {
      // Build Extractor is always quiet
      uud.setQuiet(true);
    // The user may have indicated the operation via interactivity
    if (UpgradeUserData.Operation.UPGRADE.equals(uud.getOperation())) {
      isUpgrade = true;
    } else if (UpgradeUserData.Operation.REVERSION.equals(uud.getOperation())) {
      isReversion = true;
      // The user may have indicated the operation via interactivity
      if (UpgradeUserData.Operation.UPGRADE.equals(uud.getOperation())) {
        isUpgrade = true;
      } else if (UpgradeUserData.Operation.REVERSION.equals(
          uud.getOperation())) {
        isReversion = true;
      }
    }
    return uud;
opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractorCliHelper.java
@@ -32,7 +32,9 @@
import org.opends.messages.Message;
import org.opends.quicksetup.CliUserInteraction;
import org.opends.quicksetup.UserDataException;
import org.opends.quicksetup.UserInteraction;
import org.opends.server.util.cli.CLIException;
import org.opends.server.util.cli.Menu;
import org.opends.server.util.cli.MenuBuilder;
@@ -142,6 +144,21 @@
                      CONFIRMATION_MAX_TRIES));
            }
          }
          System.out.println();
          Message cont = INFO_CONTINUE_BUTTON_LABEL.get();
          Message cancel = INFO_CANCEL_BUTTON_LABEL.get();
          UserInteraction ui = new CliUserInteraction();
          if (cancel.equals(ui.confirm(
              INFO_UPGRADE_CONFIRM_TITLE.get(),
              INFO_UPGRADE_CONFIRM_PROMPT.get(
                      uud.getInstallPackage().getAbsolutePath()),
              INFO_REVERT_CONFIRM_TITLE.get(),
              UserInteraction.MessageType.WARNING,
              new Message[] { cont, cancel },
              cont))) {
            LOG.log(Level.INFO, "User canceled upgrade.");
            return null;
          }
        } else {
          uud.setOperation(UpgradeUserData.Operation.REVERSION);
        }
opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java
@@ -1071,7 +1071,7 @@
              userInteraction(), currentVersion, newVersion);
      uo.notifyUser();
      if (uo.noServerStartFollowingOperation()) {
        // Some issue dicatates that we don't try and restart the server
        // Some issue dictates that we don't try and restart the server
        // after this operation.  It may be that the databases are no
        // longer readable after the reversion or something equally earth
        // shattering.