https://fedorahosted.org/freeipa/ticket/4302
--
Petr Vobornik
From eb9efc98484313901bfded665fbe66d60b7df350 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Mon, 8 Jun 2015 18:49:14 +0200
Subject: [PATCH] topology: allow only one node to be specified in
 topologysegment-refresh

https://fedorahosted.org/freeipa/ticket/4302
---
 ipalib/plugins/topology.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index ba99133b4b105369b317df7eb1b8623c7f483ce8..3e3f24402f28bae2b5c563919241a80137711d4d 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -236,7 +236,8 @@ class topologysegment_mod(LDAPUpdate):
 
 @register()
 class topologysegment_refresh(LDAPQuery):
-    __doc__ = _('Request a replication refresh of specified node.')
+    __doc__ = _('Request a full re-initialization of the node '
+                'retrieving data from the other node.')
 
     has_output = output.standard_value
     msg_summary = _('%(value)s')
@@ -272,6 +273,17 @@ class topologysegment_refresh(LDAPQuery):
         left = options.get('left')
         right = options.get('right')
         stop = options.get('stop')
+
+        if not left and not right:
+            raise errors.OptionError(
+                _('left or right node has to be specified')
+            )
+
+        if left and right:
+            raise errors.OptionError(
+                _('only one node can be specified')
+            )
+
         action = u'start'
         msg = _('Replication refresh for segment: "%(pkey)s" requested.')
         if stop:
@@ -279,11 +291,6 @@ class topologysegment_refresh(LDAPQuery):
             msg = _('Stopping of replication refresh for segment: "'
                     '%(pkey)s" requested.')
 
-        if not left and not right:
-            raise errors.OptionError(
-                _('at least one node has to be specified')
-            )
-
         if left:
             entry['nsds5beginreplicarefresh;left'] = [action]
         if right:
-- 
2.1.0

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