cinder/cinder/volume
Brian Rosmaita 5122b14658 Default volume_type set too early
If a volume_type is not specified in a volume-create request, change
I4da0c13b5b3f8174a30b8557f968d6b9e641b091 (introduced in Train) sets a
default volume_type in the REST API layer.  This prevents the
selection logic in cinder.volume.flows.api.create_volume.
ExtractVolumeRequestTask from being able to infer the appropriate
volume_type from the source volume, snapshot, or image metadata, and
has caused a regression where the created volume is of the default
type instead of the inferred type.

This patch removes setting the default volume_type in the REST API
and modifies the selection code in ExtractVolumeRequestTask slightly
to make sure a volume_type is always assigned in that function, and
adds and revises some tests.

Change-Id: I05915f2e32b1229ad320cd1c5748de3d63183b91
Closes-bug: #1879578
(cherry picked from commit 674c8e7286)
Conflicts:
  cinder/tests/unit/volume/flows/api/test_create_volume.py
  - cinder.tests.unit.test (victoria) -> cinder.test (pre-victoria)
(cherry picked from commit c1bdb233cf)
Conflicts:
  cinder/volume/flows/api/create_volume.py
  - add six, remove collections
  cinder/tests/unit/volume/flows/api/test_create_volume.py
  - add mock, remove unittest.mock
2020-07-12 16:10:27 -04:00
..
drivers Merge "3PAR: Fix live migration" into stable/train 2020-06-29 14:16:10 +00:00
flows Default volume_type set too early 2020-07-12 16:10:27 -04:00
targets Merge "target/spdknvmf: Add max_queue_depth configuration parameter" 2019-09-18 09:03:09 +00:00
__init__.py Fix dynamic import of CONF.volume_api_class 2016-02-12 10:50:31 -06:00
api.py Merge "Make sure stale image metadata is not used" 2019-09-25 09:50:34 +00:00
configuration.py Add support for shared "backend_defaults" config 2017-07-11 18:58:58 +00:00
driver.py Merge "Fix get_driver_options" 2019-08-05 17:32:10 +00:00
driver_utils.py Remove log translations 2017-03-19 14:59:57 +00:00
group_types.py handle no default_cgsnapshot_type 2017-11-28 21:55:29 +00:00
manager.py Make volume soft delete more thorough 2020-01-14 12:29:00 +00:00
qos_specs.py [Doc] Handle Sphinx warnings as errors 2017-08-29 16:00:09 -05:00
rpcapi.py Rename volume/utils.py to volume/volume_utils.py 2019-09-09 15:00:07 -04:00
throttling.py Implement privsep boilerplate in cinder. 2018-06-06 09:42:54 +08:00
volume_migration.py Initiating Cinder Volume Manager with large number of volumes 2019-01-11 08:19:07 -05:00
volume_types.py Untyped to Default Volume Type 2019-09-20 05:37:54 +00:00
volume_utils.py Rename volume/utils.py to volume/volume_utils.py 2019-09-09 15:00:07 -04:00