[Freeipa-devel] IPA Python API
Petr Spacek
pspacek at redhat.com
Wed Jun 17 10:54:19 UTC 2015
On 17.6.2015 07:24, Jan Cholasta wrote:
> Dne 16.6.2015 v 20:29 Drew Erny napsal(a):
>> Hi, All,
>>
>> I'm using the IPA Python API to write the Community Portal. Most of the
>> documentation for using the IPA Python API is targeted a plugin authors,
>> and this isn't a plugin for (what I think are) good reasons. I'm doing
>>
>> # in the main program
>> import api from ipalib
>> api.bootstrap(context="client")
>> api.finalize()
>> api.Backend.rpcclient.connect()
>
> Call
>
>
> api.Backend.rpcclient.connect(ccache=krbV.default_context().default_ccache())
>
> to make the problem go away.
Is there a simple way how to get a reasonable error message ('not connected to
IPA server' or so) here?
Calling commands from Python should not be that hard to debug :-)
Petr^2 Spacek
>> # and then, inside of a separate class
>> api.Command.stageuser_add(...)
>>
>> Which is how doc/examples/python-api.py shows it.
>>
>> However, calling api.Command.stageuser_add(...) causes
>> AttributeError: No context.rpcclient_... in thread 'Thread-1'
>>
>> I think this is probably related to the fact that I haven't configured
>> my program to connect to any particular IPA server, because before the
>> program errors out, it prints:
>> ipa: INFO: Forwarding 'stageuser_add' to json server 'None'
>>
>> If the problem is the lack of a target server, as I suspect, how would I
>> configure the program to connect to a particular IPA server? If this
>> isn't caused by that, what could the causes be?
More information about the Freeipa-devel
mailing list