Comment 14 for bug 1074415

Revision history for this message
Akihiro Motoki (amotoki) wrote :

Ivan,

I prefer to keeping quantum client class a thin wrapper. It means that each method should just call a single API operation.
If you add list_subnets call to list_networks(), we could not get a raw API response of network_list.

In addition your proposed change break horizon implementation since Horizon quantum api does similar thing you proposed.
(See horizon/openstack_dashboard/api/quantum.py network_list() if you want to know more detail.)
Note that I will update Horizon implementation in G-1 to follow your change if this change is accepted.

Now there are several design options:
(a) Change list_networks() (in the quantum client class) (affects to CLI and libary) <-- your proposal
(b) Add a new method like list_networks_with_subnets() to the client class (no affect to existing system)
(c) Change ListNetwork (described below) (affects to CLI only)

[detail of ListNetwork change]
it is better to change get_data() method of ListNetwork class since it is a CLI-specific change.
Unfortunately get_data of ListCommand is not so extensible.
My idea is (1) to add get_additional_data(data) method (that returns just 'data' passed as an argument) to ListCommand, (2) change get_data method in ListCommand to call get_additional_data() just after obj_lister, and (3) define get_additional_data() method in ListNetwork class to call list_subnets() and modify the response of list_networks().