freeipa/ipaserver
Rob Crittenden fe9be8c4a1 Convert values using _SYNTAX_MAPPING with --delattr
When an entry is loaded the incoming values are converted
into python datatypes automatically based on the _SYNTAX_MAPPING
value in ipaldap.

When using delattr to remove a mapped value it will fail because
the datatypes do not match up. For example date types are
datetime.datetime structions and won't match a generalized time
string.

So try to map the value to delete using _SYNTAX_MAPPING before
trying to remove the value. Fall back to trying to remove the
raw value if the mapping fails.

This won't work for some mapping types, DNs for example. Providing
only the RDN value for a DN-type, manager for example, lacks the
context to know how to construct the DN (RDN and contaner).

Fixes: https://pagure.io/freeipa/issue/9004

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2022-03-16 12:18:35 +02:00
..
advise pylint: Skip raising-bad-type 2022-03-11 13:37:08 -05:00
custodia pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
dnssec pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
install Kerberos instance: default to AES256-SHA2 for master key encryption 2022-03-16 11:14:35 +02:00
plugins Convert values using _SYNTAX_MAPPING with --delattr 2022-03-16 12:18:35 +02:00
secrets Custodia: use a stronger encryption algo when exporting keys 2022-01-31 10:08:43 +01:00
__init__.py Change FreeIPA license to GPLv3+ 2010-12-20 17:19:53 -05:00
dcerpc_common.py Py3: Replace six.text_type with str 2018-09-27 16:11:18 +02:00
dcerpc.py pylint: Fix unused-variable 2022-03-11 13:37:08 -05:00
dns_data_management.py Add URI system records for KDC 2021-08-31 18:28:27 -04:00
Makefile.am Build: Makefiles for Python packages 2016-11-09 13:08:32 +01:00
masters.py Add hidden replica feature 2019-03-28 17:57:58 +01:00
p11helper.py Grammar: whitespace is a word 2020-06-23 10:16:29 +02:00
rpcserver.py pylint: Fix unused-variable 2022-03-11 13:37:08 -05:00
servroles.py Use api.env.container_sysaccounts 2020-04-28 11:28:29 +02:00
setup.cfg Port all setup.py to setuptools 2016-10-20 18:43:37 +02:00
setup.py Also drop Custodia client and forwarder 2021-06-16 10:28:17 -04:00
topology.py pylint: Fix consider-using-dict-items 2022-03-11 13:37:08 -05:00
wsgi.py Improve wsgi app loading 2021-04-07 11:43:23 +03:00