Incorrect default type lookup when using "openstack share create"

Bug #2030686 reported by Goutham Pacha Ravi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-manilaclient
Fix Released
Low
Goutham Pacha Ravi

Bug Description

When you perform "openstack share create" without specifying a share type, the command tries to lookup a default share type for the user. However, this lookup assumes that the default share type is always called "default" - this may not be the case:

$ grep "default_share_type" /etc/manila/manila.conf
default_share_type = cephfsnfstype

$ openstack share type list
+--------------------------------------+---------------+------------+------------+--------------------------------------+-------------------------------------------+-------------+
| ID | Name | Visibility | Is Default | Required Extra Specs | Optional Extra Specs | Description |
+--------------------------------------+---------------+------------+------------+--------------------------------------+-------------------------------------------+-------------+
| c6807c53-2c73-4737-9ada-d8a313f5a79e | cephfsnfstype | public | True | driver_handles_share_servers : False | snapshot_support : True | None |
| | | | | | create_share_from_snapshot_support : True | |
| 8ffeefeb-7a42-4673-982b-5031faf6171c | dhss_false | public | False | driver_handles_share_servers : False | snapshot_support : True | None |
| | | | | | create_share_from_snapshot_support : True | |
| 8a0ec79e-f7eb-4486-a8cb-c483f1e3128c | dhss_true | public | False | driver_handles_share_servers : True | snapshot_support : True | None |
| | | | | | create_share_from_snapshot_support : True | |
+--------------------------------------+---------------+------------+------------+--------------------------------------+-------------------------------------------+-------------+

$ openstack share create nfs 1 --name testshare
There is no default share type available. You must pick a valid share type to create a share.

The lookup is happening here: https://github.com/openstack/python-manilaclient/blob/bbfd7d5468a61c7f99ac2b6e3dc5a1b3e4561c28/manilaclient/osc/v2/share.py#L206-L213

Changed in python-manilaclient:
importance: Undecided → Low
assignee: nobody → Goutham Pacha Ravi (gouthamr)
milestone: none → bobcat-client-release
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-manilaclient (master)
Changed in python-manilaclient:
status: New → In Progress
Changed in python-manilaclient:
milestone: bobcat-client-release → none
Changed in python-manilaclient:
milestone: none → caracal-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-manilaclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-manilaclient/+/890835
Committed: https://opendev.org/openstack/python-manilaclient/commit/a870c13cf1bdba15c30f0935ac2f5c637e6e8fee
Submitter: "Zuul (22348)"
Branch: master

commit a870c13cf1bdba15c30f0935ac2f5c637e6e8fee
Author: Goutham Pacha Ravi <email address hidden>
Date: Tue Aug 8 16:16:01 2023 -0700

    Fix default share type resolution in OSC

    This patch also fixes an incorrect docstring
    in the share types SDK method.

    Closes-Bug: #2030686
    Change-Id: Iaea9746e6f4e133574f5504d906a49cc80fa4243

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

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

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

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

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

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

commit ed34956613807cf67d0bc9e84f1658ae537e49a4
Author: Goutham Pacha Ravi <email address hidden>
Date: Tue Aug 8 16:16:01 2023 -0700

    Fix default share type resolution in OSC

    This patch also fixes an incorrect docstring
    in the share types SDK method.

    Closes-Bug: #2030686
    Change-Id: Iaea9746e6f4e133574f5504d906a49cc80fa4243
    (cherry picked from commit a870c13cf1bdba15c30f0935ac2f5c637e6e8fee)

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

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

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

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

commit ffaffe4f827ddcd581d151597085f7910be1d993
Author: Goutham Pacha Ravi <email address hidden>
Date: Tue Aug 8 16:16:01 2023 -0700

    Fix default share type resolution in OSC

    This patch also fixes an incorrect docstring
    in the share types SDK method.

    Closes-Bug: #2030686
    Change-Id: Iaea9746e6f4e133574f5504d906a49cc80fa4243
    (cherry picked from commit a870c13cf1bdba15c30f0935ac2f5c637e6e8fee)
    (cherry picked from commit 6981dfcde0ff4cb688cad63dec4af88fcb407151)

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

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

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

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

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

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