Patch attached.

--
Martin Basti

From 5928be7850a773420e1d4e6e001aa225a5bdce17 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Wed, 8 Jul 2015 12:19:58 +0200
Subject: [PATCH] Upgrade: Do not show upgrade failed message when IPA is not
 installed

---
 freeipa.spec.in                         | 2 +-
 ipaserver/install/ipa_server_upgrade.py | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 8fee33bd958fd375d3a0eb105611679170b0adba..e09e2f5e27f5905155487e84b5daa404a6c3b95f 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -535,7 +535,7 @@ fi
 %posttrans server
 # This must be run in posttrans so that updates from previous
 # execution that may no longer be shipped are not applied.
-/usr/sbin/ipa-server-upgrade --quiet >/dev/null || echo "IPA server upgrade failed: Inspect /var/log/ipaupgrade.log and run command ipa-server-upgrade manually."
+/usr/sbin/ipa-server-upgrade --quiet >/dev/null || :
 
 # Restart IPA processes. This must be also run in postrans so that plugins
 # and software is in consistent state
diff --git a/ipaserver/install/ipa_server_upgrade.py b/ipaserver/install/ipa_server_upgrade.py
index d0a839d0a316317622894e5b56896f91a9e29bb8..511b224927b1db0ea5cbc2468ab233f76b081d91 100644
--- a/ipaserver/install/ipa_server_upgrade.py
+++ b/ipaserver/install/ipa_server_upgrade.py
@@ -7,6 +7,7 @@ import os
 from ipalib import api
 from ipaplatform.paths import paths
 from ipapython import admintool
+from ipapython.ipa_log_manager import root_logger
 from ipaserver.install import installutils
 from ipaserver.install import server
 
@@ -50,4 +51,9 @@ class ServerUpgrade(admintool.AdminTool):
             raise admintool.ScriptError(str(e))
 
     def handle_error(self, exception):
+        if not isinstance(exception, SystemExit):
+            # do not log this message when ipa is not installed
+            root_logger.error("IPA server upgrade failed: Inspect "
+                              "/var/log/ipaupgrade.log and run command "
+                              "ipa-server-upgrade manually.")
         return installutils.handle_error(exception, self.log_file_name)
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to