[openstack-dev] [oslo] Graduate cliutils.py into oslo.utils

Victor Stinner vstinner at redhat.com
Tue Nov 10 10:29:50 UTC 2015


Hi,

At Tokyo, we discussed quickly what to do with cliutils.py of 
oslo-incubator, but for me the plan is not really concrete.

https://etherpad.openstack.org/p/mitaka-oslo-incubator-cleanup

I don't like dims' suggestion to move code inside clients, it means 
duplicating 280 lines of python in 11 clients.

It was also proposed to reuse openstackclient or the openstack SDK. I 
don't understand how novaclient can use openstackclient, since 
openstackclient depends on python-novaclient... The OpenStack SDK 
project is also a large library no? (I don't know well the OpenStack SDK 
project.)

I would prefer to move cliutils.py to oslo.utils. Only 3 clients use 
cliutils.py but don't depend on oslo.utils yet. The 8 remaining clients 
using cliutils.py already depends on oslo.utils.

An alternative is to create yet another oslo library. But it means 
creating a library for a single file of 280 lines.

What do you think?

--

On 29 "python-*client" projects, I found 11 clients using cliutils.py:

python-ceilometerclient
python-cloudkittyclient
python-heatclient
python-ironicclient
python-magnumclient
python-manilaclient
python-mistralclient
python-novaclient
python-saharaclient
python-solumclient
python-tuskarclient

9 clients are almost synchronized with oslo-incubator: only the new 
optional 'dict_value' parameter of the print_list() function is missing, 
not a big deal (since the parameter is optional, it doesn't break the API).

magnumclient and mistralclient have larger changes.

magnumclient adds a recursive keys_and_vals_to_strs() function which 
casts all dictionary keys and values to string. We may copy this feature 
in the upstream code (oslo incubator), it makes sense to me.

cliutils.py of mistralclient looks outdated, but a find_resource() 
function was also added. We can move find_resource() out of cliutils.py, 
to put it somewhere in mistralclient.

On the 11 clients using cliutils.py, 8 depend oslo.utils, whereas 3 don't.

Victor



More information about the OpenStack-dev mailing list