|
|
b7b64b |
From b9c42fed9b6f60801f908c368d0d97a2a69f7bb2 Mon Sep 17 00:00:00 2001
|
|
|
b7b64b |
From: Florence Blanc-Renaud <flo@redhat.com>
|
|
|
b7b64b |
Date: Wed, 15 Dec 2021 10:47:02 +0100
|
|
|
b7b64b |
Subject: [PATCH] Config plugin: return EmptyModlist when no change is applied
|
|
|
b7b64b |
|
|
|
b7b64b |
When ipa config-mod is called with the option --enable-sid,
|
|
|
b7b64b |
the code needs to trap EmptyModlist exception (it is expected
|
|
|
b7b64b |
that no LDAP attribute is modified by this operation).
|
|
|
b7b64b |
The code had a flaw and was checking:
|
|
|
b7b64b |
'enable_sid' in options
|
|
|
b7b64b |
instead of
|
|
|
b7b64b |
options['enable_sid']
|
|
|
b7b64b |
|
|
|
b7b64b |
"'enable_sid' in options" always returns true as this option
|
|
|
b7b64b |
is a Flag with a default value, hence always present even if
|
|
|
b7b64b |
not specified on the command line.
|
|
|
b7b64b |
|
|
|
b7b64b |
Fixes: https://pagure.io/freeipa/issue/9063
|
|
|
b7b64b |
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
|
|
|
b7b64b |
---
|
|
|
b7b64b |
ipaserver/plugins/config.py | 2 +-
|
|
|
b7b64b |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
b7b64b |
|
|
|
b7b64b |
diff --git a/ipaserver/plugins/config.py b/ipaserver/plugins/config.py
|
|
|
b7b64b |
index eae401fc3..24446beb0 100644
|
|
|
b7b64b |
--- a/ipaserver/plugins/config.py
|
|
|
b7b64b |
+++ b/ipaserver/plugins/config.py
|
|
|
b7b64b |
@@ -707,7 +707,7 @@ class config_mod(LDAPUpdate):
|
|
|
b7b64b |
if (isinstance(exc, errors.EmptyModlist) and
|
|
|
b7b64b |
call_func.__name__ == 'update_entry' and
|
|
|
b7b64b |
('ca_renewal_master_server' in options or
|
|
|
b7b64b |
- 'enable_sid' in options)):
|
|
|
b7b64b |
+ options['enable_sid'])):
|
|
|
b7b64b |
return
|
|
|
b7b64b |
|
|
|
b7b64b |
super(config_mod, self).exc_callback(
|
|
|
b7b64b |
--
|
|
|
b7b64b |
2.34.1
|
|
|
b7b64b |
|
|
|
b7b64b |
From cd735099e86304294217147ed578ac902fcf3dd3 Mon Sep 17 00:00:00 2001
|
|
|
b7b64b |
From: Florence Blanc-Renaud <flo@redhat.com>
|
|
|
b7b64b |
Date: Wed, 15 Dec 2021 10:51:05 +0100
|
|
|
b7b64b |
Subject: [PATCH] config plugin: add a test ensuring EmptyModlist is returned
|
|
|
b7b64b |
|
|
|
b7b64b |
Add a test to test_config_plugin, that calls ipa config-mod
|
|
|
b7b64b |
with the same value as already present in LDAP.
|
|
|
b7b64b |
The call must return EmptyModlist.
|
|
|
b7b64b |
|
|
|
b7b64b |
Related: https://pagure.io/freeipa/issue/9063
|
|
|
b7b64b |
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
|
|
|
b7b64b |
---
|
|
|
b7b64b |
ipatests/test_xmlrpc/test_config_plugin.py | 9 +++++++++
|
|
|
b7b64b |
1 file changed, 9 insertions(+)
|
|
|
b7b64b |
|
|
|
b7b64b |
diff --git a/ipatests/test_xmlrpc/test_config_plugin.py b/ipatests/test_xmlrpc/test_config_plugin.py
|
|
|
b7b64b |
index e981bb4a0..a8ec9f0e5 100644
|
|
|
b7b64b |
--- a/ipatests/test_xmlrpc/test_config_plugin.py
|
|
|
b7b64b |
+++ b/ipatests/test_xmlrpc/test_config_plugin.py
|
|
|
b7b64b |
@@ -312,4 +312,13 @@ class test_config(Declarative):
|
|
|
b7b64b |
'value': None,
|
|
|
b7b64b |
},
|
|
|
b7b64b |
),
|
|
|
b7b64b |
+ dict(
|
|
|
b7b64b |
+ desc='Set the value to the already set value, no modifications',
|
|
|
b7b64b |
+ command=(
|
|
|
b7b64b |
+ 'config_mod', [], {
|
|
|
b7b64b |
+ 'ipasearchrecordslimit': u'100',
|
|
|
b7b64b |
+ },
|
|
|
b7b64b |
+ ),
|
|
|
b7b64b |
+ expected=errors.EmptyModlist(),
|
|
|
b7b64b |
+ ),
|
|
|
b7b64b |
]
|
|
|
b7b64b |
--
|
|
|
b7b64b |
2.34.1
|
|
|
b7b64b |
|