From 7a6f3dd0c046db02a9cebddd7e635c2189e378ff Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Sat, 21 Jul 2012 20:43:37 +0000
Subject: [PATCH] Fix OPENDJ-522: Add capability to force the upgrade to complete if errors occur during non-interactive mode

---
 opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeIssueNotifier.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeIssueNotifier.java b/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeIssueNotifier.java
index d4c4c0b..ceb5345 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeIssueNotifier.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeIssueNotifier.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2006-2009 Sun Microsystems, Inc.
+ *      Portions copyright 2012 ForgeRock AS.
  */
 
 package org.opends.quicksetup.upgrader;
@@ -92,7 +93,7 @@
                         reason.toMessage()),
                 null);
       } else {
-        if (ui != null) {
+        if (ui.isInteractive()) {
           String lineBreak = ui.isCLI() ?
               Constants.LINE_SEPARATOR : Constants.HTML_LINE_BREAK;
           for (VersionIssueNotifier.Directive directive : issues) {
@@ -156,7 +157,7 @@
                       INFO_UPGRADE_CANCELED.get(), null);
             }
           }
-        } else {
+        } else if (!ui.isForceOnError()) {
           throw new ApplicationException(
               ReturnCode.APPLICATION_ERROR,
               INFO_ORACLE_NO_SILENT.get(), null);
@@ -179,7 +180,7 @@
     // If the import/export effect is present, append the detailed
     // instructions.
     if (effects.contains(Effect.UPGRADE_DATA_EXPORT_AND_REIMPORT_REQUIRED)) {
-      if (ui != null)
+      if (ui.isInteractive())
       {
         String lineBreak = ui.isCLI() ? Constants.LINE_SEPARATOR
             : Constants.HTML_LINE_BREAK;

--
Gitblit v1.10.0