I am testing in near master (built it about 6 weeks ago). I can see that the API behavior is inconsistent. If I do:
$ neutron net-list --sort_key name --sort_dir asc
or
$ neutron net-list --sort_key name --sort_dir desc
I get the networks sorted by name correctly, as indicated by the direction argument
If I do:
$ neutron net-list --sort_key name --debug
I get:
DEBUG: keystoneauth.session RESP: [400] Connection: keep-alive Content-Length: 123 Content-Type: application/json Date: Sun, 10 May 2020 17:42:41 GMT X-Openstack-Request-Id: req-3aa8373d-1d00-4a89-b5a5-a14782aa3a46
DEBUG: keystoneauth.session RESP BODY: {"NeutronError": {"type": "HTTPBadRequest", "message": "The number of sort_keys and sort_dirs must be same", "detail": ""}}
DEBUG: keystoneauth.session GET call to network for http://192.168.33.12:9696/v2.0/networks?sort_key=name used request id req-3aa8373d-1d00-4a89-b5a5-a14782aa3a46
I am testing in near master (built it about 6 weeks ago). I can see that the API behavior is inconsistent. If I do:
$ neutron net-list --sort_key name --sort_dir asc
or
$ neutron net-list --sort_key name --sort_dir desc
I get the networks sorted by name correctly, as indicated by the direction argument
If I do:
$ neutron net-list --sort_key name --debug
I get:
DEBUG: keystoneauth. session RESP: [400] Connection: keep-alive Content-Length: 123 Content-Type: application/json Date: Sun, 10 May 2020 17:42:41 GMT X-Openstack- Request- Id: req-3aa8373d- 1d00-4a89- b5a5-a14782aa3a 46 session RESP BODY: {"NeutronError": {"type": "HTTPBadRequest", "message": "The number of sort_keys and sort_dirs must be same", "detail": ""}} session GET call to network for http:// 192.168. 33.12:9696/ v2.0/networks? sort_key= name used request id req-3aa8373d- 1d00-4a89- b5a5-a14782aa3a 46
DEBUG: keystoneauth.
DEBUG: keystoneauth.
Now, in the case of:
$ neutron agent-list --sort_key binary --sort_dir asc
$ neutron agent-list --sort_key binary --sort_dir desc
$ neutron agent-list --sort_key binary
$ neutron agent-list --sort_key binnary
$ neutron agent-list --sort_key binnary --sort_dir asc
I get the exam same list all the time. So the API is just ignoring the sort arguments.
This bug is related to https:/ /bugs.launchpad .net/neutron/ +bug/1749820, which was marked as closed. So let's keep this one and continue the conversation here