mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
topology: allow only one node to be specified in topologysegment-refresh
https://fedorahosted.org/freeipa/ticket/4302 Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user