manila/manila/api
haixin a9e0ca254e Fix logic that determines a share exists before manage
The share "manage" API checks whether
an existing/known share is being imported by
matching the export path provided to existing
shares.

This lookup does not consider the
fact that shares may have multiple export
locations, because it relies on an old/deprecated
"export_location" property on shares which
was added to provide backwards compatibility
to the API that presented only one export
location per share.

Further, it's possible to get a
"ERROR: Invalid share: Share already exists"
exception even when no such share exists in the
database.

Fix the lookup by using the "export_location_path"
based lookup which is faster, since it performs
a meaningful join on the export locations table;
and remove the parameters "protocol"
and "share_type_id" - these things make no
difference when there's a duplicated export
location. We'll consider "host" as a lookup
parameter since we can't be sure that export
locations are unique in a deployment - but they
ought to be unique for a given host.

Closes-Bug: #1848608
Closes-Bug: #1893718
Change-Id: I1d1aef0c2b48764789b43b91b258def6464b389f
Co-Authored-By: Goutham Pacha Ravi <gouthampravi@gmail.com>
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
(cherry picked from commit 1b5771ef15)
(cherry picked from commit 5cff4d4b3f)
2020-12-08 21:06:25 -08:00
..
contrib Port share type extensions to core API 2015-11-12 14:58:20 +00:00
middleware Fix UnicodeDecodeError when decode API input 2018-02-07 06:37:32 +00:00
openstack [doc] Annotate max api microversion in Ussuri 2020-04-21 09:42:46 -07:00
v1 Fix logic that determines a share exists before manage 2020-12-08 21:06:25 -08:00
v2 Remove experimental flag from share groups feature 2020-04-09 21:13:54 +00:00
views Create share from snapshot in another pool or backend 2020-04-09 11:15:22 -03:00
__init__.py Remove enable_v1_api and enable_v2_api config opts 2016-08-23 08:27:22 +02:00
auth.py Remove log translations in api 1/5 2017-03-29 16:55:05 +08:00
common.py Merge "Support query user message by timestamp" 2020-04-03 18:11:35 +00:00
extensions.py If only .pyc exist, the extension API will be disabled 2020-03-27 17:10:33 +08:00
urlmap.py Trivial: Remove unused logging import 2015-12-28 21:44:26 -05:00
versions.py [pylint] Fix/ignore pylint errors in non-test modules 2019-02-25 17:23:15 +00:00