openstack-python-openstackc.../openstackclient
whoami-rajat 9425e6fcb6 Fix: create image from volume command
Currently the command ``openstack image create --volume`` calls cinderclient
to upload the volume to image service (glance) but OSC passes ``visibility``
and ``protected`` fields which are only available in microversion 3.1 or
greater. This generates an error if the user is using volume microversion
< 3.1 and wants to create an image from volume.
This patch fixes that by only passing ``visibility`` and ``protected`` fields
when the volume microversion is 3.1 or greater and fail otherwise i.e. the
following 3 cases:
1) visibility/protected argument + mv >= 3.1 = pass
2) visibility/protected argument + mv < 3.1 = fail
3) not visibility/protected argument + any mv = pass

Changes:
  openstackclient/tests/unit/volume/v3/fakes.py
  
NOTE(croelandt): Imported openstackclient/tests/unit/volume/v3/fakes.py from
the Yoga branch. Used FakeType instead of FakeVolumeType for compatibility with
older class names.

Story: 2010060
Task: 45511
Change-Id: I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc
(cherry picked from commit 9eea28ba59)
(cherry picked from commit 849e7e93f8)
(cherry picked from commit 665d93ff07)
2022-07-04 11:35:48 +00:00
..
api Remove usage of six 2020-10-07 02:15:25 +00:00
common project cleanup 2021-02-02 08:14:34 +00:00
compute compute: Fix filtering servers by tags 2021-10-13 12:51:28 +01:00
identity Merge "Add name and enabled param in ListDomain parser" 2020-12-22 13:30:59 +00:00
image Fix: create image from volume command 2022-07-04 11:35:48 +00:00
locale/tr_TR/LC_MESSAGES Imported Translations from Zanata 2018-03-01 07:25:50 +00:00
network network: Add missing subnet unset --gateway <subnet-id> 2021-03-05 14:15:20 +00:00
object Add storage policy option to create container command 2020-02-19 10:08:48 +13:00
tests Fix: create image from volume command 2022-07-04 11:35:48 +00:00
volume Allow to resize in-use volumes 2020-11-11 09:18:49 +00:00
__init__.py Clean up W503 and E402 pep8 errors 2018-04-15 12:23:06 +09:00
i18n.py Remove log translations 2017-03-21 17:23:09 +08:00
shell.py Remove usage of six 2020-10-07 02:15:25 +00:00