diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2015-06-10 14:44:09 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-06-15 09:38:46 +0200 |
commit | 6b153ba876edf1ed9249ed29420a4af2b2e1830d (patch) | |
tree | f8b2c8a1d3e6c7dc160f002172bcb20815791bbd | |
parent | bae80b00a668b678c608d04c1b5d96871a85ece9 (diff) | |
download | freeipa-6b153ba876edf1ed9249ed29420a4af2b2e1830d.tar.gz freeipa-6b153ba876edf1ed9249ed29420a4af2b2e1830d.tar.xz freeipa-6b153ba876edf1ed9249ed29420a4af2b2e1830d.zip |
topology: restrict direction changes
topology plugin doesn't properly handle:
- creation of segment with direction 'none' and then upgrade to other
direction
- downgrade of direction
These situations are now forbidden in API.
part of: https://fedorahosted.org/freeipa/ticket/4302
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
-rw-r--r-- | API.txt | 7 | ||||
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | install/ui/src/freeipa/topology.js | 11 | ||||
-rw-r--r-- | ipalib/plugins/topology.py | 3 |
4 files changed, 9 insertions, 16 deletions
@@ -4757,7 +4757,7 @@ arg: Str('topologysuffixcn', cli_name='topologysuffix', multivalue=False, primar arg: Str('cn', attribute=True, cli_name='name', maxlength=255, multivalue=False, primary_key=True, required=True) option: Str('addattr*', cli_name='addattr', exclude='webui') option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui') -option: StrEnum('iparepltoposegmentdirection', attribute=True, cli_name='direction', default=u'both', multivalue=False, required=True, values=(u'both', u'left-right', u'right-left', u'none')) +option: StrEnum('iparepltoposegmentdirection', attribute=True, cli_name='direction', default=u'both', multivalue=False, required=True, values=(u'both', u'left-right', u'right-left')) option: Str('iparepltoposegmentleftnode', attribute=True, cli_name='leftnode', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9.][a-zA-Z0-9.-]{0,252}[a-zA-Z0-9.$-]?$', required=True) option: Str('iparepltoposegmentrightnode', attribute=True, cli_name='rightnode', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9.][a-zA-Z0-9.-]{0,252}[a-zA-Z0-9.$-]?$', required=True) option: StrEnum('nsds5replicaenabled', attribute=True, cli_name='enabled', multivalue=False, required=False, values=(u'on', u'off')) @@ -4786,7 +4786,7 @@ arg: Str('topologysuffixcn', cli_name='topologysuffix', multivalue=False, primar arg: Str('criteria?', noextrawhitespace=False) option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui') option: Str('cn', attribute=True, autofill=False, cli_name='name', maxlength=255, multivalue=False, primary_key=True, query=True, required=False) -option: StrEnum('iparepltoposegmentdirection', attribute=True, autofill=False, cli_name='direction', default=u'both', multivalue=False, query=True, required=False, values=(u'both', u'left-right', u'right-left', u'none')) +option: StrEnum('iparepltoposegmentdirection', attribute=True, autofill=False, cli_name='direction', default=u'both', multivalue=False, query=True, required=False, values=(u'both', u'left-right', u'right-left')) option: Str('iparepltoposegmentleftnode', attribute=True, autofill=False, cli_name='leftnode', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9.][a-zA-Z0-9.-]{0,252}[a-zA-Z0-9.$-]?$', query=True, required=False) option: Str('iparepltoposegmentrightnode', attribute=True, autofill=False, cli_name='rightnode', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9.][a-zA-Z0-9.-]{0,252}[a-zA-Z0-9.$-]?$', query=True, required=False) option: StrEnum('nsds5replicaenabled', attribute=True, autofill=False, cli_name='enabled', multivalue=False, query=True, required=False, values=(u'on', u'off')) @@ -4804,13 +4804,12 @@ output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None) output: Output('truncated', <type 'bool'>, None) command: topologysegment_mod -args: 2,13,3 +args: 2,12,3 arg: Str('topologysuffixcn', cli_name='topologysuffix', multivalue=False, primary_key=True, query=True, required=True) arg: Str('cn', attribute=True, cli_name='name', maxlength=255, multivalue=False, primary_key=True, query=True, required=True) option: Str('addattr*', cli_name='addattr', exclude='webui') option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui') option: Str('delattr*', cli_name='delattr', exclude='webui') -option: StrEnum('iparepltoposegmentdirection', attribute=True, autofill=False, cli_name='direction', default=u'both', multivalue=False, required=False, values=(u'both', u'left-right', u'right-left', u'none')) option: StrEnum('nsds5replicaenabled', attribute=True, autofill=False, cli_name='enabled', multivalue=False, required=False, values=(u'on', u'off')) option: Str('nsds5replicastripattrs', attribute=True, autofill=False, cli_name='stripattrs', multivalue=False, required=False) option: Str('nsds5replicatedattributelist', attribute=True, autofill=False, cli_name='replattrs', multivalue=False, required=False) @@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000 # # ######################################################## IPA_API_VERSION_MAJOR=2 -IPA_API_VERSION_MINOR=130 -# Last change: pvoborni - disallow mod of topologysegment nodes +IPA_API_VERSION_MINOR=131 +# Last change: pvoborni - toposegment direction restrictions diff --git a/install/ui/src/freeipa/topology.js b/install/ui/src/freeipa/topology.js index 20c78cb16..c8a8acbe9 100644 --- a/install/ui/src/freeipa/topology.js +++ b/install/ui/src/freeipa/topology.js @@ -127,14 +127,7 @@ return { other_field: 'cn', z_index: 1 }, - { - $type: 'radio', - name: 'iparepltoposegmentdirection', - options: IPA.create_options([ - 'both', 'left-right', 'right-left', 'none' - ]), - default_value: 'both' - } + 'iparepltoposegmentdirection' ] }, { @@ -180,7 +173,7 @@ return { $type: 'radio', name: 'iparepltoposegmentdirection', options: IPA.create_options([ - 'both', 'left-right', 'right-left', 'none' + 'both', 'left-right', 'right-left' ]), default_value: 'both' } diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py index 9574b78f6..be2ac0bd2 100644 --- a/ipalib/plugins/topology.py +++ b/ipalib/plugins/topology.py @@ -98,10 +98,11 @@ class topologysegment(LDAPObject): 'iparepltoposegmentdirection', cli_name='direction', label=_('Connectivity'), - values=(u'both', u'left-right', u'right-left', u'none'), + values=(u'both', u'left-right', u'right-left'), default=u'both', doc=_('Direction of replication between left and right replication ' 'node'), + flags={'no_update'}, ), Str( 'nsds5replicastripattrs?', |