Hi!<br><br>The library is accessible at <a href="https://github.com/aababilov/python-openstackclient-base">https://github.com/aababilov/python-openstackclient-base</a>. I have update it so it doesn't require monkey patch for nova and keystone clients anymore.<br>
<br>I'm familiar with <a href="https://github.com/openstack/python-openstackclient" target="_blank">python-openstackclient</a>, and it will be an awesome tool. But it is a console client, and I am talking about an API client library. This library can be used by python-{nova,keystone,glance}client that are used, in their turn, by <a href="https://github.com/openstack/python-openstackclient" target="_blank">python-openstackclient</a>, horizon, etc.<br>
<br>I used modified code from glance that does chunking manually. It's worth to mention that glance client can be simpler - it should not deal with chunkes  anymore. Requred changes for glanceclient are accessible here: <a href="https://github.com/aababilov/python-glanceclient/commit/7b04a1672a4ba09281ea107c47a8b20d9a0c62bb">https://github.com/aababilov/python-glanceclient/commit/7b04a1672a4ba09281ea107c47a8b20d9a0c62bb</a>.<br>
<br>openstack-common seems to be a stub for a server and there is no client code, isn't it?<br><br>Sincerely<br><br><div class="gmail_quote">On Tue, Jun 19, 2012 at 8:14 PM, Monty Taylor <span dir="ltr"><<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<div class="im"><br>
On 06/19/2012 09:43 AM, Alexey Ababilov wrote:<br>
> Hi!<br>
><br>
> Unfortunately, nova, keystone, and glance clients are very inconsistent.<br>
> A lot of code is copied between all these clients instead of moving it<br>
> to a common library. The code was edited without synchronization between<br>
> clients, so, they have different behaviour:<br>
><br>
</div>>   * all client constructors use different parameters (api_key in nova or<br>
<div class="im">>     password in keystone and so on);<br>
</div>>   * keystoneclient authenticates immediately in __init__, while<br>
<div class="im">>     novaclient does in lazily during first method call;<br>
</div>>   * {keystone,nova}client can manage service catalogs and accept<br>
<div class="im">>     keystone's auth URI while glanceclient allows endpoints only;<br>
</div>>   * keystoneclient can support authorization with an unscoped token but<br>
>     novaclient doesn't;<br>
>   * novaclient uses class composition while keystoneclient uses inheritance.<br>
<div class="im">><br>
> I have developed a library to unify current clients. The library can be<br>
> used as-is, but it would be better if openstack clients dropped their<br>
> common code (base.py, exceptions.py and so on) and just began to import<br>
> common code.<br>
<br>
</div>There are two projects already in work focused on various aspects of<br>
this. openstack-common is the place that we put code that should be<br>
shared between the clients. python-openstackclient is a project that<br>
aims at a single consistent interface.<br>
<br>
I'm thrilled that you have done some work in this area, but it would be<br>
great if you could do this in the context of the two fairly official<br>
projects that already exist.<br>
<br>
Thanks!<br>
<span class="HOEnZb"><font color="#888888">Monty<br>
</font></span><div class="im HOEnZb"><br>
<br>
> Here is an example of using unified clients.<br>
><br>
> from openstackclient_base import patch_clients<br>
> from openstackclient_base.client import HttpClient<br>
> http_client = HttpClient(username="...", password="...", tenant_name="...", auth_uri="...")<br>
><br>
> from openstackclient_base.nova.client import ComputeClient<br>
> print ComputeClient(http_client).servers.list()<br>
><br>
> from openstackclient_base.keystone.client import IdentityPublicClient<br>
> print IdentityPublicClient(http_client).tenants.list()<br>
><br>
><br>
><br>
</div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Alessio Ababilov<br>Software Engineer<br>
                        
                                
                                
                                        Grid Dynamics<br><br>