Thank you for your answer, it works ! <br><br><div class="gmail_quote">2010/4/19 Jason Gerard DeRose <span dir="ltr"><<a href="mailto:jderose@redhat.com">jderose@redhat.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Mon, 2010-04-19 at 16:22 +0200, ALAHYANE Rachid wrote:<br>
> Hi,<br>
><br>
><br>
> Using F12 with the alpha version of ipa, I want to know if there is<br>
> some ways to call implemented methods like  user_show() with my own<br>
> script python. My goal is to call these methods with a client xml-rpc<br>
> that I will to developpe later.<br>
><br>
><br>
> On my client, I tried this but it does not work :(<br>
<br>
</div>It needs more documentation, but see doc/examples/python-api.py<br>
<br>
Let me know if that doesn't work or if you get stuck.  You will need to<br>
do a kinit first.<br>
<div><div></div><div class="h5"><br>
> ----------------------------------------------------------------------------<br>
> >>> from ipalib import api<br>
> >>> api.bootstrap_with_global_options()<br>
> (<Values at 0xb74f556c: {'debug': None, 'conf': None, 'env': None,<br>
> 'verbose': None}>, [])<br>
> >>> api.load_plugins()<br>
> >>> api.finalize()<br>
> >>> api.Method.user_show.__doc__<br>
> '\n    Display user.\n    '<br>
> >>> api.Method.user_show(u'raca')<br>
> Traceback (most recent call last):<br>
>   File "<stdin>", line 1, in <module><br>
>   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line<br>
> 398, in __call__<br>
>     ret = self.run(*args, **options)<br>
>   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line<br>
> 667, in run<br>
>     return self.forward(*args, **options)<br>
>   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line<br>
> 688, in forward<br>
>     return self.Backend.xmlclient.forward(<a href="http://self.name" target="_blank">self.name</a>, *args, **kw)<br>
>   File "/usr/lib/python2.6/site-packages/ipalib/rpc.py", line 403, in<br>
> forward<br>
>     command = getattr(self.conn, name)<br>
>   File "/usr/lib/python2.6/site-packages/ipalib/backend.py", line 96,<br>
> in __get_conn<br>
>     <a href="http://self.id" target="_blank">self.id</a>, threading.currentThread().getName())<br>
> AttributeError: no context.xmlclient in thread 'MainThread'<br>
><br>
><br>
> ----------------------------------------------------------------------------<br>
><br>
><br>
> Have you any idea ? or some pertinent docs<br>
><br>
><br>
> Sorry for my bad English :)<br>
><br>
><br>
> --<br>
> Meilleures salutations / Best Regards<br>
><br>
> Rachid ALAHYANE<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Freeipa-users mailing list<br>
> <a href="mailto:Freeipa-users@redhat.com">Freeipa-users@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/freeipa-users" target="_blank">https://www.redhat.com/mailman/listinfo/freeipa-users</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Meilleures salutations / Best Regards<br><br>Rachid ALAHYANE<br><br>