On 02.05.2016 17:19, Petr Vobornik wrote:
On 05/02/2016 04:26 PM, Martin Basti wrote:
https://fedorahosted.org/freeipa/ticket/5820

Patch attached.


Copying the err message 3 times is not very nice. It should be in a
constant otherwise we risk that they will get out of sync in a future.
Updated patch attached.
From 1c91b111439da0eefdce39b648d36e444e5eb030 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Fri, 29 Apr 2016 17:13:55 +0200
Subject: [PATCH] ipactl: advertise --ignore-service-failure option

For non-critical services which are failing may be beneficial for users
to ignore them and let IPA critical services start. For this a hint to
use --ignore-service-failue option should be shown.

https://fedorahosted.org/freeipa/ticket/5820
---
 install/tools/ipactl | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/install/tools/ipactl b/install/tools/ipactl
index b41b10c8a65fc8d4f2f4c169e08b2c89125909a4..ccd3e437edc15ca72c60008be50f4a997dc0e85f 100755
--- a/install/tools/ipactl
+++ b/install/tools/ipactl
@@ -38,6 +38,13 @@ from ipapython.dn import DN
 from ipaplatform import services
 from ipaplatform.paths import paths
 
+
+MSG_HINT_IGNORE_SERVICE_FAILURE = (
+    "Hint: You can use --ignore-service-failure option for forced start in "
+    "case that a non-critical service failed"
+)
+
+
 class IpactlError(ScriptError):
     pass
 
@@ -314,6 +321,7 @@ def ipa_start(options):
             stop_services(svc_list)
             stop_dirsrv(dirsrv)
 
+            emit_err(MSG_HINT_IGNORE_SERVICE_FAILURE)
             raise IpactlError("Aborting ipactl")
 
 def ipa_stop(options):
@@ -456,6 +464,7 @@ def ipa_restart(options):
                 stop_services(svc_list)
                 stop_dirsrv(dirsrv)
 
+                emit_err(MSG_HINT_IGNORE_SERVICE_FAILURE)
                 raise IpactlError("Aborting ipactl")
 
     if len(new_svc_list) != 0:
@@ -478,6 +487,7 @@ def ipa_restart(options):
                 stop_services(svc_list)
                 stop_dirsrv(dirsrv)
 
+                emit_err(MSG_HINT_IGNORE_SERVICE_FAILURE)
                 raise IpactlError("Aborting ipactl")
 
 def ipa_status(options):
-- 
2.5.5

-- 
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