ac7d03
From 5b9fe9df34d0eff697adefa171d35a57e561c17e Mon Sep 17 00:00:00 2001
ac7d03
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
ac7d03
Date: Tue, 28 Mar 2017 16:15:21 +0200
ac7d03
Subject: [PATCH] Allow erasing ipaDomainResolutionOrder attribute
ac7d03
MIME-Version: 1.0
ac7d03
Content-Type: text/plain; charset=UTF-8
ac7d03
Content-Transfer-Encoding: 8bit
ac7d03
ac7d03
Currently when trying to erase the ipaDomainResolutionOrder attribute we
ac7d03
hit an internal error as the split() method is called on a None object.
ac7d03
ac7d03
By returning early in case of empty string we now allow removing the
ac7d03
ipaDomainResolutionOrder attribute by both calling delattr or setting
ac7d03
its value to an empty string.
ac7d03
ac7d03
https://pagure.io/freeipa/issue/6825
ac7d03
ac7d03
Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
ac7d03
Reviewed-By: Martin Basti <mbasti@redhat.com>
ac7d03
---
ac7d03
 ipaserver/plugins/config.py | 5 +++++
ac7d03
 1 file changed, 5 insertions(+)
ac7d03
ac7d03
diff --git a/ipaserver/plugins/config.py b/ipaserver/plugins/config.py
ac7d03
index 232c88121fd2c938f77a1e76e1d7c9f0ad8e7550..b50e7a4691bd76bfaf7c332cd89b0f1bf55bac46 100644
ac7d03
--- a/ipaserver/plugins/config.py
ac7d03
+++ b/ipaserver/plugins/config.py
ac7d03
@@ -359,6 +359,11 @@ class config(LDAPObject):
ac7d03
 
ac7d03
         domain_resolution_order = entry_attrs[attr_name]
ac7d03
 
ac7d03
+        # setting up an empty string means that the previous configuration has
ac7d03
+        # to be cleaned up/removed. So, do nothing and let it pass
ac7d03
+        if not domain_resolution_order:
ac7d03
+            return
ac7d03
+
ac7d03
         # empty resolution order is signalized by single separator, do nothing
ac7d03
         # and let it pass
ac7d03
         if domain_resolution_order == DOMAIN_RESOLUTION_ORDER_SEPARATOR:
ac7d03
-- 
ac7d03
2.12.2
ac7d03