Re: [Freeipa-devel] [PATCH 0162] Do not update result of *-config-show with empty server attributes

2016-06-21 Thread Martin Basti



On 21.06.2016 12:57, Pavel Vomacka wrote:




On 06/20/2016 03:35 PM, Martin Babinsky wrote:

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




Hello,

thank you for the patch, it works for me. But I didn't do the code 
review.


--
Pavel^3 Vomacka



code ACK

Pushed to master: 702ab0008b3c781f34e62925b2dbb6f49b49a571

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

Re: [Freeipa-devel] [PATCH 0162] Do not update result of *-config-show with empty server attributes

2016-06-21 Thread Pavel Vomacka



On 06/20/2016 03:35 PM, Martin Babinsky wrote:

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




Hello,

thank you for the patch, it works for me. But I didn't do the code review.

--
Pavel^3 Vomacka
-- 
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

[Freeipa-devel] [PATCH 0162] Do not update result of *-config-show with empty server attributes

2016-06-20 Thread Martin Babinsky

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

--
Martin^3 Babinsky
From a366d731d276efd34e1f0924ddc4e51041c1814c Mon Sep 17 00:00:00 2001
From: Martin Babinsky 
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