<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 22.10.2015 10:44, Martin Babinsky
wrote:<br>
</div>
<blockquote cite="mid:5628A1F1.8050602@redhat.com" type="cite"><a class="moz-txt-link-freetext" href="https://fedorahosted.org/freeipa/ticket/5181">https://fedorahosted.org/freeipa/ticket/5181</a>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
Thank you for the patch.<br>
<br>
1)<br>
+OPTIONAL_SERVICES = {<br>
+ 'DNS',<br>
+ 'CA',<br>
+ 'KRA',<br>
+ 'ADTRUST',<br>
+ 'EXTID',<br>
+ 'DNSKeyExporter',<br>
+ 'DNSSEC',<br>
+ 'DNSKeySync',<br>
+}<br>
<br>
This did not scale well, maybe we should improve it to use some
general solution for whole IPA to distinct mandratory and optionl
service, but I do not know how (or if it is possible)<br>
<br>
2)<br>
+ search_filter=('(&(objectclass=ipaConfigObject)'<br>
+ '(ipaConfigString=enabledService))')<br>
<br>
Common user cannot read ipaConfigString, so this will work only for
admins, I do not see any limitations of access in code for other
users.<br>
<br>
3)<br>
+ opt_components = [<br>
+ r['cn'][0] for r in result if r['cn'][0] in
OPTIONAL_SERVICES<br>
+ ]<br>
Probably instead of indexing, you may use result.single_value['cn']<br>
<br>
Martin^2<br>
</body>
</html>