https://fedorahosted.org/freeipa/ticket/5960

--
Martin^3 Babinsky
From a366d731d276efd34e1f0924ddc4e51041c1814c Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Mon, 20 Jun 2016 15:29:21 +0200
Subject: [PATCH] Do not update result of *-config-show with empty server
 attributes

If a server attribute such as DNSSec Key master is unset, None is passed as
the attribute value into the upper API layers and displayed in the output of
`dnsconfig-show` et al. We should not show this and leave the attribute empty
instead.

https://fedorahosted.org/freeipa/ticket/5960
---
 ipaserver/plugins/serverroles.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ipaserver/plugins/serverroles.py b/ipaserver/plugins/serverroles.py
index 4a44fca5a82038452a9e33d3df8919754b8bf2f3..e22eadd7b163469cc9fc4472640aa64d21c9d38f 100644
--- a/ipaserver/plugins/serverroles.py
+++ b/ipaserver/plugins/serverroles.py
@@ -134,9 +134,11 @@ class serverroles(Backend):
         except NotImplementedError:
             return result
 
-        result.update(
-            {name: attr.get(self.api) for name, attr in
-             assoc_attributes.items()})
+        for name, attr in assoc_attributes.items():
+            attr_value = attr.get(self.api)
+
+            if attr_value is not None:
+                result.update({name: attr_value})
 
         return result
 
-- 
2.5.5

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