Share list sorted by 'availability_zone' return 'wrong sorting key' error.

Bug #1920888 reported by Jon Cui
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-manilaclient
Confirmed
Medium
Jon Cui

Bug Description

Description
===========

List shares CLI with sorting key 'availability_zone' return http 400 error,
and error message is "ERROR: Invalid input received: Wrong sorting key provided - 'availability_zone'".

Steps to reproduce
==================

* Run manila list command with sorting key named 'availability_zone'.
 for instance, run 'manila list --sort-key availability_zone --sort-dir asc' and check
 returned text.

Expected result
===============

# manila list --sort-key availability_zone --sort-dir asc
+--------------------------------------+--------------+------+-------------+-----------+-----------+--------------------+----------------------------------+-------------------+
| ID | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone |
+--------------------------------------+--------------+------+-------------+-----------+-----------+--------------------+----------------------------------+-------------------+
| 7edf862c-a743-4efd-8d68-95e0bf835aa5 | None | 5 | CEPHFS | available | False | default_share_type | manila@ZTE_CloveStorage-2#native | mova |
| 23172497-e5c7-4f0b-9882-a2f27b6016cc | test-czl2022 | 5 | NFS | available | False | nfs_type | manila@ZTE_CloveStorage-1#nfs | nova |
| bdea38e3-8588-4032-9e16-e0a3b7cd7678 | None | 2 | NFS | available | False | default_share_type | manila@ZTE_CloveStorage-1#nfs | nova |
| 97bafa3a-e142-41a2-b725-bdbcbfb1d7ba | None | 1 | NFS | available | False | default_share_type | manila@ZTE_CloveStorage-1#nfs | nova |
+--------------------------------------+--------------+------+-------------+-----------+-----------+--------------------+----------------------------------+-------------------+

Actual result
=============

# manila list --sort-key availability_zone --sort-dir asc
ERROR: Invalid input received: Wrong sorting key provided - 'availability_zone'. (HTTP 400) (Request-ID: req-3b18c0cd-9f99-4dce-8238-4e69062092a9)

Environment
===========

version: Train

Jon Cui (czl389)
Changed in manila:
assignee: nobody → Jon Cui (czl389)
Jon Cui (czl389)
description: updated
Jon Cui (czl389)
summary: - Share list sorted by 'availability_zone' return http 400 error.
+ Share list sorted by 'availability_zone' return 'wrong sorting key'
+ error.
Jon Cui (czl389)
description: updated
description: updated
Revision history for this message
Victoria Martinez de la Cruz (vkmc) wrote :

Fix proposed to master in https://review.opendev.org/c/openstack/python-manilaclient/+/782635. Seems we will need to backport this to Train. Thanks Jon Cui!

Changed in manila:
importance: Undecided → Medium
status: New → Confirmed
affects: manila → python-manilaclient
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-manilaclient (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/python-manilaclient/+/792289

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

This issue was fixed in the openstack/python-manilaclient 2.7.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-manilaclient (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/python-manilaclient/+/792289
Committed: https://opendev.org/openstack/python-manilaclient/commit/c338a6c2d02bf94e46904e5998ebdf1a357d2866
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit c338a6c2d02bf94e46904e5998ebdf1a357d2866
Author: czl389 <czl389@163.com>
Date: Wed Mar 24 14:10:15 2021 +0800

    Fix error in CLI 'manila list' with sorting key 'availability_zone'.

    CLI 'manila list --sort-key availability_zone' return http 400 code,
    and error message 'Wrong sorting key provided'.

    The cause is that sortble key name in sqlAlchemy model field is
    'availability_zone_id' , not 'availability_zone'. So we need a
    translation in CLI implement.

    Closes-Bug: #1920888
    Change-Id: Ied983d85ca08a123b78bf8b05085fad8fe5bc2c5
    (cherry picked from commit 69031b558d600e507b86dc1ee0a7087ac9436219)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-manilaclient 2.6.1

This issue was fixed in the openstack/python-manilaclient 2.6.1 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.