Filtering shares by extra-specs provides wrong results
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Shared File Systems Service (Manila) |
Fix Released
|
Low
|
Kafilat Adeleke |
Bug Description
Description
===========
It's possible to use share type "extra_specs" as key=value pairs to filter shares by. However, this doesn't seem to work as intended.
Steps to reproduce
==================
1) Create a share type, set some extra-specs - for example: snapshot_
2) Create another share type, set the opposite value to the extra spec chosen above, example: snapshot_
3) Create a few shares of that share type
4) Filter the share by extra specs
Manila CLI Commands:
$ manila type-create typeX False --snapshot-support True
$ manila type-create typeY False --snapshot-support False
$ manila create nfs 1 --share-type typeX --name typeXShare
$ manila create nfs 2 --share-type typeY --name typeYShare
$ manila list --extra-specs snapshot_
Expected result
===============
Only shares matching the share type that has the extra-specs requested are retrieved by the API call
Actual result
=============
All shares matching any share type that have the extra-spec key or value are retrieved by the API
Example: http://
Environment
===========
1. Running manila from the trunk/development branch
2. This isn't just a CLI issue, the issue is reproducible directly using CURL on the API as well.
Changed in manila: | |
importance: | Undecided → Low |
tags: | added: low-hanging-fruit |
Changed in manila: | |
milestone: | none → xena-2 |
assignee: | nobody → Kafilat Adeleke (kafilat-adeleke) |
status: | New → Confirmed |
Changed in manila: | |
status: | Confirmed → In Progress |
The problem seems to be this or_ in the query: https:/ /github. com/openstack/ manila/ blame/95d60c0d4 8330bcae5d232c6 dff221c058b7247 2/manila/ db/sqlalchemy/ api.py# L2020-L2021