On 09.11.2015 14:37, Gabe Alford wrote:
Hello,

Fix for https://fedorahosted.org/freeipa/ticket/5424

thanks,

Gabe


Thank you for you patch, almost ACK, but I propose following changes (patch attached) in error message.

Let me know if you agree with the change.

Martin
From eda85f8e18dda352adc01e403cd60529a257511a Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Sun, 8 Nov 2015 17:18:17 -0700
Subject: [PATCH] ipa-replica-manage del continues when host does not exist in
 domain level 1

- Raises error and stops operation unless --cleanup is specified.

https://fedorahosted.org/freeipa/ticket/5424
---
 install/tools/ipa-replica-manage | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index b9998da44dcc1f01c5eb342ee713634de0ee84ee..2de6fd7993be290fefa5c2c7d07733c39d457ed6 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -740,7 +740,13 @@ def del_master_managed(realm, hostname, options):
     try:
         api.Command.server_del(hostname_u)
     except errors.NotFound:
-        print("Server entry already deleted: %s" % (hostname))
+        if not options.cleanup:
+            print("{hostname} does not exist.".format(hostname=hostname))
+            print("Please specify an actual server or add the --cleanup "
+                  "option to force clean up.")
+            sys.exit(1)
+        else:
+            print("Server entry already deleted: %s" % (hostname))
 
     # 6. Cleanup
     try:
-- 
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