summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-06-20 15:29:21 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-21 13:07:24 +0200
commit702ab0008b3c781f34e62925b2dbb6f49b49a571 (patch)
treeb33ad7c85801ef4a0cea4f71c1c07519382d229d /ipaserver/plugins
parent894be1bd50905b86d87244d0ede3f266e9737b9a (diff)
downloadfreeipa-702ab0008b3c781f34e62925b2dbb6f49b49a571.tar.gz
freeipa-702ab0008b3c781f34e62925b2dbb6f49b49a571.tar.xz
freeipa-702ab0008b3c781f34e62925b2dbb6f49b49a571.zip
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 Reviewed-By: Pavel Vomacka <pvomacka@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/serverroles.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ipaserver/plugins/serverroles.py b/ipaserver/plugins/serverroles.py
index 4a44fca5a..e22eadd7b 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