pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0016-Allow-value-no-for-replica-certify-all-attr-in-abort.patch

590d18
From c2b5f7b164268ec8d15916031260c87dc6c9ffd5 Mon Sep 17 00:00:00 2001
590d18
From: Martin Basti <mbasti@redhat.com>
590d18
Date: Thu, 16 Jul 2015 16:26:55 +0200
590d18
Subject: [PATCH] Allow value 'no' for replica-certify-all attr in
590d18
 abort-clean-ruv subcommand
590d18
590d18
--force option set replica-certify-all to 'no' during abort-clean-ruv
590d18
subcommand
590d18
590d18
https://fedorahosted.org/freeipa/ticket/4988
590d18
590d18
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
590d18
---
590d18
 install/tools/ipa-replica-manage       | 2 +-
590d18
 install/tools/man/ipa-replica-manage.1 | 2 +-
590d18
 ipaserver/install/replication.py       | 3 ++-
590d18
 3 files changed, 4 insertions(+), 3 deletions(-)
590d18
590d18
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
590d18
index e525a02f4c60350b7a943abab4b4aedd957e984a..50a57f70ec452c0df5bf2ea55d2a136e8149aa41 100755
590d18
--- a/install/tools/ipa-replica-manage
590d18
+++ b/install/tools/ipa-replica-manage
590d18
@@ -470,7 +470,7 @@ def abort_clean_ruv(realm, ruv, options):
590d18
     print
590d18
     thisrepl = replication.ReplicationManager(realm, options.host,
590d18
                                               options.dirman_passwd)
590d18
-    thisrepl.abortcleanallruv(ruv)
590d18
+    thisrepl.abortcleanallruv(ruv, options.force)
590d18
 
590d18
     print "Cleanup task stopped"
590d18
 
590d18
diff --git a/install/tools/man/ipa-replica-manage.1 b/install/tools/man/ipa-replica-manage.1
590d18
index 8a7c78f39eeb6c7902ed99e7bed37e32eb0e92dc..c09ed362f3143e6e38716e1b3a96e90001a64674 100644
590d18
--- a/install/tools/man/ipa-replica-manage.1
590d18
+++ b/install/tools/man/ipa-replica-manage.1
590d18
@@ -49,7 +49,7 @@ Manages the replication agreements of an IPA server. The available commands are:
590d18
 \- Run the CLEANALLRUV task to remove a replication ID.
590d18
 .TP
590d18
 \fBabort\-clean\-ruv\fR [REPLICATION_ID]
590d18
-\- Abort a running CLEANALLRUV task.
590d18
+\- Abort a running CLEANALLRUV task. With \-\-force option the task does not wait for all the replica servers to have been sent the abort task, or be online, before completing.
590d18
 .TP
590d18
 \fBlist\-clean\-ruv\fR
590d18
 \- List all running CLEANALLRUV and abort CLEANALLRUV tasks.
590d18
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
590d18
index 0f420106e093e8a7a277016857d27aaa48daa4dc..e9af88dc4356d4fd5495f4fea399ab09c75db953 100644
590d18
--- a/ipaserver/install/replication.py
590d18
+++ b/ipaserver/install/replication.py
590d18
@@ -1451,7 +1451,7 @@ class ReplicationManager(object):
590d18
 
590d18
         wait_for_task(self.conn, dn)
590d18
 
590d18
-    def abortcleanallruv(self, replicaId):
590d18
+    def abortcleanallruv(self, replicaId, force=False):
590d18
         """
590d18
         Create a task to abort a CLEANALLRUV operation.
590d18
         """
590d18
@@ -1465,6 +1465,7 @@ class ReplicationManager(object):
590d18
                 'replica-id': [replicaId],
590d18
                 'objectclass': ['top', 'extensibleObject'],
590d18
                 'cn': ['abort %d' % replicaId],
590d18
+                'replica-certify-all': ['no'] if force else ['yes'],
590d18
             }
590d18
         )
590d18
         try:
590d18
-- 
590d18
2.4.3
590d18