<div>Hi,</div><div><br></div><div>As I don't know how to specify the xmlrpc_uri in the bootstrap() method, I modified this file /usr/lib/python2.6/site-packages/ipalib/constants.py.</div><div><br></div><div>I put this line </div>

<div>('xmlrpc_uri', '<a href="https://server.domain.org/ipa/xml">https://server.domain.org/ipa/xml</a>')</div><div>instead </div><div>('xmlrpc_uri', '<a href="http://localhost:8888/ipa/xml">http://localhost:8888/ipa/xml</a>')</div>

<div><br></div><div>Here is the execution of my_script inside the ipython console</div><div><br></div><div>---------------------------------------------------------------</div><div><div>In [1]: from ipalib import api</div>

<div><br></div><div>In [2]: api.bootstrap_with_global_options(context='webservices')</div><div>Out[2]: </div><div>(<Values at 0x889ee8c: {'debug': None, 'conf': None, 'env': None, 'verbose': None}>,</div>

<div> [])</div><div><br></div><div>In [3]: api.finalize()</div><div><br></div><div>In [4]: api.env.xmlrpc_uri</div><div>Out[4]: u'<a href="https://server.domain.org/ipa/xml">https://server.domain.org/ipa/xml</a>'</div>

<div><br></div><div>In [5]: api.Backend.xmlclient.connect()</div><div><br></div><div>In [6]: api.Command.user_show(u'admin')</div><div>---------------------------------------------------------------------------</div>

<div>ConversionError                           Traceback (most recent call last)</div><div><br></div><div>/var/www/<ipython console> in <module>()</div><div><br></div><div>/usr/lib/python2.6/site-packages/ipalib/frontend.pyc in __call__(self, *args, **options)</div>

<div>    399         self.validate(**params)</div><div>    400         (args, options) = self.params_2_args_options(**params)</div><div>--> 401         ret = self.run(*args, **options)</div><div>    402         if (</div>

<div>    403             isinstance(ret, dict)</div><div><br></div><div>/usr/lib/python2.6/site-packages/ipalib/frontend.pyc in run(self, *args, **options)</div><div>    668         if self.api.env.in_server:</div><div>    669             return self.execute(*args, **options)</div>

<div>--> 670         return self.forward(*args, **options)</div><div>    671</div><div>    672     def execute(self, *args, **kw):</div><div><br></div><div>/usr/lib/python2.6/site-packages/ipalib/frontend.pyc in forward(self, *args, **kw)</div>

<div>    689         Forward call over XML-RPC to this same command on server.</div><div>    690         """</div><div>--> 691         return self.Backend.xmlclient.forward(<a href="http://self.name">self.name</a>, *args, **kw)</div>

<div>    692</div><div>    693     def finalize(self):</div><div><br></div></div><div><div>/usr/lib/python2.6/site-packages/ipalib/rpc.pyc in forward(self, name, *args, **kw)</div><div>    412             if e.faultCode in self.__errors:</div>

<div>    413                 error = self.__errors[e.faultCode]</div><div>--> 414                 raise error(message=e.faultString)</div><div>    415             raise UnknownError(</div><div>    416                 code=e.faultCode,</div>

<div><br></div><div>ConversionError: invalid 'uid': Only one value is allowed</div><div><br></div></div><div><div>---------------------------------------------------------------</div></div><div><br></div><div>Hem, Yet another problem :( </div>

<div><br></div><div>---</div>Meilleures salutations / Best Regards<br><br>Rachid ALAHYANE<br><br>
<br><br><div class="gmail_quote">2010/4/22 ALAHYANE Rachid <span dir="ltr"><<a href="mailto:afkkir@gmail.com">afkkir@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Thank you for answer, now I get this error :<div>-----------------------------------------------------</div><div>NetworkError: cannot connect to u'<a href="http://localhost:8888/ipa/xml" target="_blank">http://localhost:8888/ipa/xml</a>': Permission denied</div>


<div><div>-----------------------------------------------------</div><div><br></div><div>How can I specify my ipa server address. Can I do this in the api.bootstrap() method ? </div><div>What is the difference between api.bootstrap() and api.bootstrap_with_global_options()  ?</div>

<div class="im">
<div><br></div><div>---</div>Meilleures salutations / Best Regards<br><br>Rachid ALAHYANE<br><br>
<br><br></div><div class="gmail_quote">2010/4/22 Jason Gerard DeRose <span dir="ltr"><<a href="mailto:jderose@redhat.com" target="_blank">jderose@redhat.com</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div></div><div>On Wed, 2010-04-21 at 15:21 -0400, Rob Crittenden wrote:<br>
> ALAHYANE Rachid wrote:<br>
> > Here is my apache logs :<br>
> > ------------------------------------------------------------------------------------------------<br>
> > ==> /var/log/httpd/error_log <==<br>
> > [Wed Apr 21 20:02:51 2010] [warn] mod_python (pid=1529,<br>
> > interpreter='<a href="http://rpcserver.domain.org" target="_blank">rpcserver.domain.org</a> <<a href="http://rpcserver.domain.org" target="_blank">http://rpcserver.domain.org</a>>'):<br>
> > Module directory listed in "sys.path". This may cause problems. Please<br>
> > check code. File being imported is<br>
> > "/usr/lib/python2.6/site-packages/webservices/account.py".<br>
> > [Wed Apr 21 20:02:51 2010] [notice] mod_python (pid=1529,<br>
> > interpreter='<a href="http://rpcserver.domain.org" target="_blank">rpcserver.domain.org</a> <<a href="http://rpcserver.domain.org" target="_blank">http://rpcserver.domain.org</a>>'):<br>
> > Importing module '/usr/lib/python2.6/site-packages/webservices/account.py'<br>
> > /usr/lib/python2.6/site-packages/mod_python/importer.py:32:<br>
> > DeprecationWarning: the md5 module is deprecated; use hashlib instead<br>
> >   import md5<br>
> > ipa: ERROR: Could not create log_dir '/root/.ipa/log'<br>
> > ipa: ERROR: could not load plugin module<br>
> > '/usr/lib/python2.6/site-packages/ipalib/plugins/migration.py'<br>
> > Traceback (most recent call last):<br>
> >   File "/usr/lib/python2.6/site-packages/ipalib/plugable.py", line 533,<br>
> > in import_plugins<br>
> >     __import__(fullname)<br>
> >   File "/usr/lib/python2.6/site-packages/ipalib/plugins/migration.py",<br>
> > line 33, in <module><br>
> >     from ipaserver.plugins.ldap2 import ldap2<br>
> >   File "/usr/lib/python2.6/site-packages/ipaserver/__init__.py", line<br>
> > 33, in <module><br>
> >     api.bootstrap(context='server', debug=True, log=None)<br>
> >   File "/usr/lib/python2.6/site-packages/ipalib/plugable.py", line 380,<br>
> > in bootstrap<br>
> >     self.__doing('bootstrap')<br>
> >   File "/usr/lib/python2.6/site-packages/ipalib/plugable.py", line 365,<br>
> > in __doing<br>
> >     '%s.%s() already called' % (self.__class__.__name__, name)<br>
> > StandardError: API.bootstrap() already called<br>
><br>
> Very strange. You explicitly set the context to 'webservices' and this<br>
> backtrace shows it as 'server' which is why migration.py is trying to<br>
> load ldap2 (and blowing up).<br>
><br>
> Jason, any ideas?<br>
<br>
</div></div>Okay, took me a while to realize what's going on... in alpha2 we were<br>
still running the server under mod_python (we have since switched to<br>
mod_wsgi).<br>
<br>
In alpha2, when ipaserver is imported, ipaserver/__init__.py tries to<br>
import mod_python (which would indicate we are running under the Apache<br>
process).  When mod_python could be imported, we always initialized IPA<br>
for use in the server.  The worked fine for us at the time, but it<br>
obviously causes problems when trying to use the library from another<br>
mod_python handler.<br>
<br>
I recommend you try working with the current code from git, where this<br>
implied initialization has been removed:<br>
<br>
    git clone git://<a href="http://git.fedorahosted.org/git/freeipa.git" target="_blank">git.fedorahosted.org/git/freeipa.git</a><br>
<br>
I attached a script that I use to install a bunch of dependencies for<br>
building the rpm (or srpm).<br>
<br>
After you have these dependencies installed, you can then build and<br>
install ipa doing something like this:<br>
<br>
    cd freeipa<br>
    make rpms<br>
    yum install --nogpgcheck dist/rpms/*.rpm<br>
    ipa-server-install<br>
<br>
<br>
Hope this helps!<br>
<br>
> rob<br>
<br>
</blockquote></div></div></div><br></div>
</blockquote></div><br>