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>
This commit is contained in:
Martin Babinsky
2016-06-20 15:29:21 +02:00
committed by Martin Basti
parent 894be1bd50
commit 702ab0008b

View File

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