Change CLI option, label and type to reflect that it is a only a DN
of the suffix.
--
Petr Vobornik
From 746ac711ba96e9f5726e2aa37814e376a197219c Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Tue, 1 Dec 2015 13:02:18 +0100
Subject: [PATCH] topologysuffix: change iparepltopoconfroot API properties

Change CLI option, label and type to reflect that it is a only a DN
of the suffix.
---
 API.txt                    |  6 +++---
 VERSION                    |  4 ++--
 ipalib/plugins/topology.py | 10 ++++------
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/API.txt b/API.txt
index 1e6942d067034cdc4b1d165fbe5d8ae580ecb688..60c98c31aa85d6c8879cd145f3d84188d4fea5b7 100644
--- a/API.txt
+++ b/API.txt
@@ -4921,7 +4921,7 @@ args: 1,6,3
 arg: Str('cn', attribute=True, cli_name='name', 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: Str('iparepltopoconfroot', attribute=True, cli_name='suffix', maxlength=255, multivalue=False, required=True)
+option: DNParam('iparepltopoconfroot', attribute=True, cli_name='suffix_dn', multivalue=False, required=True)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Str('setattr*', cli_name='setattr', exclude='webui')
 option: Str('version?', exclude='webui')
@@ -4941,7 +4941,7 @@ args: 1,8,4
 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', multivalue=False, primary_key=True, query=True, required=False)
-option: Str('iparepltopoconfroot', attribute=True, autofill=False, cli_name='suffix', maxlength=255, multivalue=False, query=True, required=False)
+option: DNParam('iparepltopoconfroot', attribute=True, autofill=False, cli_name='suffix_dn', multivalue=False, query=True, required=False)
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Int('sizelimit?', autofill=False, minvalue=0)
@@ -4957,7 +4957,7 @@ arg: Str('cn', attribute=True, cli_name='name', multivalue=False, primary_key=Tr
 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: Str('iparepltopoconfroot', attribute=True, autofill=False, cli_name='suffix', maxlength=255, multivalue=False, required=False)
+option: DNParam('iparepltopoconfroot', attribute=True, autofill=False, cli_name='suffix_dn', multivalue=False, required=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Flag('rights', autofill=True, default=False)
 option: Str('setattr*', cli_name='setattr', exclude='webui')
diff --git a/VERSION b/VERSION
index 69a8a29708041d8e395c909060a14532c6855ca5..b7f261b5c5927053e2c2bfa4e3e7075c07caab5c 100644
--- a/VERSION
+++ b/VERSION
@@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
 #                                                      #
 ########################################################
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=160
-# Last change: jcholast - server: use topologysuffix name in iparepltopomanagedsuffix
+IPA_API_VERSION_MINOR=161
+# Last change: pvoborni - topologysuffix: change iparepltopomanagedsuffix type
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index 2c54bbc4dacd04ab95e55c82852428f6b0e4b1aa..40f9fa8038d4bcb6c0eeb82a37ac796d732b82fd 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -5,7 +5,7 @@
 import six
 
 from ipalib import api, errors
-from ipalib import Int, Str, Bool, StrEnum, Flag
+from ipalib import Int, Str, Bool, StrEnum, Flag, DNParam
 from ipalib.plugable import Registry
 from ipalib.plugins.baseldap import (
     LDAPObject, LDAPSearch, LDAPCreate, LDAPDelete, LDAPUpdate, LDAPQuery,
@@ -342,12 +342,10 @@ class topologysuffix(LDAPObject):
             primary_key=True,
             label=_('Suffix name'),
         ),
-        Str(
+        DNParam(
             'iparepltopoconfroot',
-            maxlength=255,
-            cli_name='suffix',
-            label=_('LDAP suffix to be managed'),
-            normalizer=lambda value: value.lower(),
+            cli_name='suffix_dn',
+            label=_('Managed LDAP suffix DN'),
         ),
     )
 
-- 
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