On 10/13/2015 10:15 AM, Petr Vobornik wrote:
On 10/13/2015 10:02 AM, Oleg Fayans wrote:
NACK

UI still shows the connectivity information at

http://<hostname>/ipa/ui/#/e/topologysuffix/topologysegment/realm

Showing it is correct and desired - both in CLI and Web UI.

The end state should be that UIs will create new segments with
direction=both and they will not allow to modify it.

So the issue, ticket #5222 is IMO about, is that CLI asks for a value in
interactive prompt which could be used to change the value from both to
some other.


CLI is OK, though

On 10/12/2015 05:57 PM, Martin Babinsky wrote:
https://fedorahosted.org/freeipa/ticket/5222


Sending updated patch. Now the connectivity is displayed but can't be manipulated.

--
Martin^3 Babinsky
From dda232f9ddcad44a9e9d7863371eb026da4d2fad Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Mon, 12 Oct 2015 17:49:50 +0200
Subject: [PATCH 1/2] hide topology segment direction in topology command CLI
 and webui interface

https://fedorahosted.org/freeipa/ticket/5222
---
 API.txt                    | 6 ++----
 VERSION                    | 4 ++--
 ipalib/plugins/topology.py | 1 +
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/API.txt b/API.txt
index cf5446114a9ccffad8d87421b4cd75c92ff267ee..3dcb8954a4b8f8ecb63585ac748263dea1c3b220 100644
--- a/API.txt
+++ b/API.txt
@@ -4799,12 +4799,11 @@ output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDA
 output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
 output: PrimaryKey('value', None, None)
 command: topologysegment_add
-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, 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'))
 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'))
@@ -4828,12 +4827,11 @@ output: Output('result', <type 'dict'>, None)
 output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
 output: ListOfPrimaryKeys('value', None, None)
 command: topologysegment_find
-args: 2,15,4
+args: 2,14,4
 arg: Str('topologysuffixcn', cli_name='topologysuffix', multivalue=False, primary_key=True, query=True, required=True)
 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'))
 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'))
diff --git a/VERSION b/VERSION
index a14b89f289f7d859f381cf78a742a5a5d038d491..cdda198c6ce3148dcf785149dc3ce050782e8caa 100644
--- a/VERSION
+++ b/VERSION
@@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
 #                                                      #
 ########################################################
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=156
-# Last change: pvoborni - add vault container commands
+IPA_API_VERSION_MINOR=157
+# Last change: mbabinsk - hide segment direction from topology commands
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index c6b86b5909cf5ef2c02515f7a6cbe4e987a927a9..2b82215e273d959fdb207801ed146b843460bae5 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -105,6 +105,7 @@ class topologysegment(LDAPObject):
             label=_('Connectivity'),
             values=(u'both', u'left-right', u'right-left'),
             default=u'both',
+            autofill=True,
             doc=_('Direction of replication between left and right replication '
                   'node'),
             flags={'no_option', 'no_update'},
-- 
2.4.3

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