<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Thanks. It was a pretty long weekend’s work.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">As for easier, I’ll be honest: I was really only able to do what I did by thoroughly reading the IPA source code. There’s some quite good documentation embedded in some of the Python source files, so the Python side was pretty easy, but I found the JavaScript side to be a real challenge. It was very trial-and-error. I still have no idea why I can’t get an attribute_table to work in place of a multivalue (see install/ui/js/freeipa/widget.js).</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I think a quite important thing to pass on to others is how to debug IPA: You can use self.log.debug() calls in Python (to the pre-configured logging framework) if you invoke the ipa command as “ipa -d -e in_server=True” and that’s very helpful … but to make that work I had to install a global anyone all-permissions ACI. Otherwise I got an insufficient-access error that threw me out of the program before any LDAP create/update/delete calls could complete. Maybe I missed a command-line option or something.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">On the JavaScript side, what worked best for me was to use Firebug with Firefox and make console.log() calls. I gather that you can basically do that without Firebug, but I’m not a web developer, so I went with what I knew — or rather vaguely remembered from the last time I wrote a web page, back in the 90s.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">As for the rest, it really boiled down to monkey-see-monkey-do mimicry. I can’t find a range validator in the source code, so I want to write my own. Let me go grep the source to find examples of validators and see how they’re written. And so on. The hard parts were when I wanted to do things that I don’t think FreeIPA does itself, like a validator that executes an LDAP query. I had to flail my way through that one and probably did it all wrong.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I do have one concrete suggestion. You might maybe consider taking some chunk of functionality and packaging it as a separate, installable “reference plugin.” DNS might be too complex for that, considering it has its tendrils in host.js etc. Maybe automount might be a good candidate. I bring this up because a good example is the best documentation. When somebody asks “How do I write a plugin?” you can just point and say “Why, like this.”</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Just a thought.</div> <div id="bloop_sign_1462977157625880832" class="bloop_sign"></div> <br><p class="airmail_on">On May 11, 2016 at 4:03:04 AM, Petr Vobornik (<a href="mailto:pvoborni@redhat.com">pvoborni@redhat.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>On 05/10/2016 09:39 PM, Jeffery Harrell wrote:
<br>> As promised yesterday, here’s the link to my bespoke DHCP plugin. It’s really  
<br>> nothing, just a little thing I whipped up for my own use.
<br>>  
<br>> https://github.com/jefferyharrell/IPA-dhcp
<br>>  
<br>>  
<br>
<br>Very nice. This is probably the most complex 'external' IPA plugin I've
<br>seen.
<br>
<br>You must have put quite a lot of effort into making it happen. Were
<br>there any areas in code/docs/wiki/... you encountered which you would
<br>like to see improved in FreeIPA or maybe some obstacles removed so that
<br>plugins like this can be made easier?
<br>
<br>Regards
<br>--  
<br>Petr Vobornik
<br></div></div></span></blockquote></body></html>