summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2015-06-08 18:49:14 +0200
committerPetr Vobornik <pvoborni@redhat.com>2015-06-10 14:14:09 +0200
commit4232c39f6767d27b9f812a15cfc5ee2c5be69d5e (patch)
tree05c95b541b71615336c2d3b6d9f9f9e6d49a7c44 /ipalib/plugins
parent62ef11efad4ebbb8fa6f13a15c5ed8e833e90d43 (diff)
downloadfreeipa-4232c39f6767d27b9f812a15cfc5ee2c5be69d5e.tar.gz
freeipa-4232c39f6767d27b9f812a15cfc5ee2c5be69d5e.tar.xz
freeipa-4232c39f6767d27b9f812a15cfc5ee2c5be69d5e.zip
topology: allow only one node to be specified in topologysegment-refresh
https://fedorahosted.org/freeipa/ticket/4302 Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipalib/plugins')
-rw-r--r--ipalib/plugins/topology.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index ba99133b4..3e3f24402 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: