vhdx is also a format of the disk valid value in v2 version,
so add it in disk_format.
Related-Bug: 1635518
Co-Authored-By: Stuart McLaren <stuart.mclaren@hpe.com>
Change-Id: I7d82d4a4bdb180a53e86552f6f6b3bed908e6dc0
Commands like glance md-namespace-show <namespace> fail because
of a breaking change in warlock 1.3.0's model creation factory
method.
Warlock introduced a new kwarg 'resolver' in model_factory method
but changed its position with the 'base_class' kwarg. Since we
were calling the model_factory method with positional arg, this
broke the model creation.
Closes-Bug: #1596573
Change-Id: Ic7821f4fdb1b752e0c7ed2bc486299a06bf485c1
Image schema that is located in glance client
is seriously outdated, we need to updated it
and bring it in line with the server version.
Change-Id: I5a79a84a9c07b9ee821a71a5bd2d61cb4299ad72
This code removes unnecessary PATCH requests
for tags updating if they were not modified.
Change-Id: I8eced32f39d0c98e0b26014e7b2341ab6580ff01
Closes-bug: 1587999
Enabled following hacking checks from tox.ini:
- H233 Python 3.x incompatible use of print operator
- H303 no wildcard import
- H404 multi line docstring should start with a summary
Change-Id: I2553bcd3e80c00acc08d135a1d2dadfb6cda49fe
Partial-Bugs: #1475054
Now the help message of namespace and resource_type are wrong,
we could see a <unavailable> error when try to get the help
information, such as "glance help md-namespace-create".
See the patch[1] to get more information. the patch[1] added
image schema, but the metadata schema are needed as well.
This patch adds the current metadata schema into client, so that
help text can't be rendered when there schema is not available in
the system.
[1]: https://review.openstack.org/#/c/209536/3
Change-Id: I2ab94d8768114a7e5c475310ba094af653627658
Closes-Bug: #1536430
When docs are generated with pbr command 'warnerrors = True'
there are many doc problems that are shown. This patch fixes
these problems.
Change-Id: Idb804ab924782b6d7d379494987bdba2acbce568
Closes-Bug: #1557235
After commit Ieb03aaba887492819f9c58aa67f7acfcea81720e, the command
location-update is totally broken now. This patch removes the updating
for an image from non-empty to empty since it's not supported now.
And also removing the default value of metadata for location-update
cli command because now the only purpose of location-update is updating
the location's metadata, so it doesn't make sense to give it a default
value which may update existing metadata by mistake.
Closes-Bug: #1537626
Change-Id: I9ce98e6c63996bbfdbc56761055e37a871f9d3e2
In case do_image_delete() is called on an image that is
in use and can't be deleted by the driver a HTTPConflict
error is raised in glance. Catch this error and print a
propper error message.
Closes-Bug: #1551037
Change-Id: Id17098f27511df8e05e56b8df21e748921223bd9
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
A download of a deactivated image may result in a 403.
The cli should catch this error rather than stack trace.
We also catch other unexpected http responses.
Change-Id: If33fbc3a56cdb02b3ab32a6479a67fff20b4b1a9
Closes-bug: 1523612
If it has a value of boolean true,
this keyword indicates that the instance property SHOULD NOT be changed,
and attempts by a user agent to modify the value of this property are expected to be rejected by a server.
The value of this keyword MUST be a boolean.
The default value is false.
Further link for reference: http://json-schema.org/latest/json-schema-hypermedia.html#anchor15
Closes-Bug: #1521581
Depends-On: I279fba4099667d193609a31259057b897380d6f0
Change-Id: I96717506259c0d28500b8747369c47029b1dd9b6
Currently location-add, location-delete and location-update
shows <ID> in help messages as metavar for image id. It may be
not clear to the users so we need to change this to <IMAGE_ID>.
Change-Id: I59c787e449fa34bc792de179993c55f59734b9fe
Closes-Bug: #1535220
Current description of instance-uuid may confuse users because
they may think that instance-uuid can serve as basis for image
but it just stores instance-uuid as image-metadata.
So we need to enhance the description in glanceclient.
Change-Id: I55829d106c9d25374df6538b3071104ee5f215f2
Closes-Bug: #1496822
Glance client has a custom check that generates exception if
location has not been returned by image-get request.
This check should on server side and it should be managed by
policy rules when do location-add action.
That also allows to increase possibility of migrating Heat
to v2[1].
NOTE: After this patch, we'll raise a HTTPBadRequest from
server side instead of HTTPConflict when a user adds a
duplicate location.
[1]: https://review.openstack.org/#/c/240450/
Co-Authored-By: wangxiyuan <wangxiyuan@huawei.com>
Change-Id: I778ad2a97805b4d85eb0430c603c27a0a1c148e0
Closes-bug: #1493026
These are server-generated, not user-generated, and schema validation
should not be necessary.
Rework a unit test that enforces this; bad data should be blocked
at ingest, not blocked on reads.
Co-authored-by: Stuart McLaren <stuart.mclaren@hp.com>
Change-Id: Ib1926fec0e858b6eed43c7931a6d6c3a1708e70e
Closes-Bug: 1501046
Related Change: If79779a4c52c8dc5c4f39192d3d247335a76ba24
This help is also used for OpenStack Command-Line Interface Reference.
Change-Id: Iadce779afebe4aa80026e46f169546aba9055477
Partial-Bug: #1432813
Add docker to v2 image_schema
Add docker to v2 unit tests
This is related to following glance api extension.
https://review.openstack.org/#/c/249282/
Co-Authored-By: Kairat Kushaev <kkushaev@mirantis.com>
Closes-Bug: #1519402
Change-Id: Ia015f027788b49c1b0002fb3e3a93ac825854596
When the image locations are blank, glance client will get a http response
with no content, glance client should show user no data could be found,
instead of processing the blank response body that will lead to exception.
Glance client will also get a 204 response when an image is in a queued
state (this is true for 'master' and liberty/kilo/juno based servers).
Closes-Bug: #1472449
Co-Authored-by: Stuart McLaren <stuart.mclaren@hp.com>
Change-Id: I5d3d02d6aa7c8dd054cd2933e15b4a26e91afea1
The help for image-create states that --file 'Must be present if images
are not passed to the client via stdin.'
However, doing image-create without --file is a valid operation - it
queues a file to be created.
Change-Id: I8167c6a891fa2540c84e3b888031d90a34a9b5fc
Add translation support for v2 shell help messages. It allows
to detect the messages that needs to be translated for translation
team.
Change-Id: Id1fb0355090d4e223d13c15100e6726e15563670
It turns out the server does not support this, and the underlying
code gets very unhappy.
Co-Authored-By:Itisha <ishadewan07@gmail.com>
Change-Id: If67c11da28adbb2d793430d122e3930cc278737f
Client doesn't support image deletion in batches in v2 now.
It's useful. So it's need to add it.
Change-Id: Idf5a6890b3fd01a65fecab2033b21367c30bc6b1
Closes-bug:#1485407
Self is not meant to exist as it is a READ ONLY property, that is not
meant to exist as something the user can change.
Closes-bug: 1496024
Change-Id: I28fd51a4cbef40fc7c90999fe8121611c7f89f21