[openstack-dev] [oslo] Graduate apiclient library

Victor Stinner vstinner at redhat.com
Tue Nov 10 11:45:49 UTC 2015


Hi,

Le 10/11/2015 07:29, Kekane, Abhishek a écrit :
> We have done extensive analysis to figure out the differences of usages of
> different oslo-incubator/openstack/common/apiclient modules used in the
> respective Openstack python client libraries and added all our
> observations in the google spreadsheet [2].

Good job! I added my +2 to your spec.
https://review.openstack.org/#/c/235200/


> Possible resolutions:-
> 1) Remove auth_plugin.py from respective python client libraries and add
> all required common functionality in auth.py. Add auth.py module into the
> new apiclient library.
> 2) Remove auth.py completely and add auth_plugins.py module in the
> respective python client libraries. No need to add auth.py into the new
> apiclient library.
> 3) Check if keystoneauth library has all needed functionality present in
> auth.py and auth_plugin.py. If present, don¹t include auth.py in the new
> client library and eliminate auth_plugin.py from python client libraries
> and instead use keystoneauth wherever needed.

I don't like (2): security matters, it's better to use the same code in 
all clients.

IMHO the best would be (3): put required functions directly in keystoneauth.

If it's not possible for whatever reason, (1) is my second favorite choice.


> exceptions.py
> ===================
>
> Please refer to the exception classes present in the respective python
> client libraries in the google spreadsheet ³exception_details².
> All common exceptions from respective python client libraries should be
> moved to the exception.py module and this module should be part of the new
> apiclient library.

Agreed, but only common exceptions. For example, only solumclient 
defines and uses NotUnique, there is no need to put it the oslo.apiclient.


> fake_client.py
> ===================
>
> Retain this module as it is for unit testing purpose.

It might be moved to oslo_apiclient/tests/ directory.


> Possible resolutions:
> 1. Move utils.py to the new apiclient library and delete find_resource
> method from all python client libraries and make them use it from the
> apiclient library
> 2. Simply not include utils.py to the new apiclient library and implement
> find_resource method in the manila client.
> We prefer to implement option #1.

Since all clients need this function, I would prefer to put it in the 
new library. I hope that it's not to hard to refactorize the code to 
have one unique implementation.


Victor



More information about the OpenStack-dev mailing list