`openstack network list --external` breaks with openstacksdk 0.11.0 + openstackclient 3.14.0

Bug #1746535 reported by Luigi Toscano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack SDK
Fix Released
Undecided
Adrian Turjak

Bug Description

tl;dr:

$ openstack network list --external
Invalid query params: router:external

The above command works with openstackclient 3.14.0+openstacksdk 0.9.19.

It is correct that upper-constraints.txt from requirements.git contains openstacksdk===0.9.19, but tempest tests ignores that, so this is visible whenever the CLI clients are tested through the specific tempest class.

From a quick IRC discussion with morderd, openstackclient 3.14.0 should work with openstacksdk 0.11.0, so this bug is assigned directly to openstacksdk.

Revision history for this message
Adrian Turjak (adriant-y) wrote :

This was introduced by https://review.openstack.org/#/c/532723/ as this made the query params checking be strict about what was supplied so consumers weren't attempting to do bogus queries and expecting results. This causes us to fail loudly.

Problem here is that the openstackclient is actually supplying both the server-side name, and the client-side name: https://github.com/openstack/python-openstackclient/blob/master/openstackclient/network/v2/network.py#L500-L501

This worked because previously the server-side name was just dropped on the floor and silently ignored, but the client-side name was used, hence why the queries returned correctly.

Fix is to allow both server-side and client-side names as query pararms, but take precedence when both are supplied for the client-side ones. This gives us the strictness we want, while fixing this case where a consumer used both, or server-side names.

Changed in python-openstacksdk:
status: New → Confirmed
assignee: nobody → Adrian Turjak (adriant-y)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstacksdk (master)

Fix proposed to branch: master
Review: https://review.openstack.org/539722

Changed in python-openstacksdk:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstacksdk (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/539937

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstacksdk (master)

Reviewed: https://review.openstack.org/539722
Committed: https://git.openstack.org/cgit/openstack/python-openstacksdk/commit/?id=6f38b4ed927a5b425c107974fb51b37b6342acce
Submitter: Zuul
Branch: master

commit 6f38b4ed927a5b425c107974fb51b37b6342acce
Author: Adrian Turjak <email address hidden>
Date: Thu Feb 1 11:50:14 2018 +1300

    Add server-side names to query param checking

    Rework the query params checking to include server-side names,
    as well as move to dedicated function on QueryParameters.

    Change transpose logic to include server-side names as fallback,
    with precedence for client-side names.

    Add tests for these changes, and fix missing assertEqual in old
    query mapping test.

    Change-Id: I3705075a0ea2911a06619a6e4dd13233c725887e
    Closes-bug: #1746535

Changed in python-openstacksdk:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstacksdk (stable/queens)

Reviewed: https://review.openstack.org/539937
Committed: https://git.openstack.org/cgit/openstack/python-openstacksdk/commit/?id=a65b18eab0aa6db51ec365801d2cd5b076e65647
Submitter: Zuul
Branch: stable/queens

commit a65b18eab0aa6db51ec365801d2cd5b076e65647
Author: Adrian Turjak <email address hidden>
Date: Thu Feb 1 11:50:14 2018 +1300

    Add server-side names to query param checking

    Rework the query params checking to include server-side names,
    as well as move to dedicated function on QueryParameters.

    Change transpose logic to include server-side names as fallback,
    with precedence for client-side names.

    Add tests for these changes, and fix missing assertEqual in old
    query mapping test.

    Change-Id: I3705075a0ea2911a06619a6e4dd13233c725887e
    Closes-bug: #1746535

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstacksdk 0.11.2

This issue was fixed in the openstack/python-openstacksdk 0.11.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstacksdk 0.12.0

This issue was fixed in the openstack/python-openstacksdk 0.12.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.