Commit Graph

22 Commits

Author SHA1 Message Date
Evgeny Antyshev 6ab6a740ff Add ploop in disk_format
"ploop" image format is supported in upstream Glance
https://review.openstack.org/341633

And similar patch has been added in python-openstackclient:
https://review.openstack.org/411405

Co-Authored-By: yuyafei <yu.yafei@zte.com.cn>
Change-Id: I1471224df97cf5fecfe7f02e549855af81c45848
Related-Bug: 1650342
2017-01-19 14:31:01 +00:00
Li Wei efb5e2aa32 Add vhdx in disk_format
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
2017-01-10 07:41:02 +00:00
Danny Al-Gaaf 860908c517 Catch InUseByStore case in do_image_delete
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>
2016-03-09 23:27:02 +01:00
Jenkins 6aaa6f2f8c Merge "Handle 403 forbidden on download" 2016-02-29 13:04:08 +00:00
Stuart McLaren 5b9f21b38b Handle 403 forbidden on download
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
2016-02-24 18:31:38 +00:00
Jenkins 2db882c41c Merge "Add docker to image_schema on glance v2 cli" 2016-01-14 15:24:07 +00:00
Atsushi SAKAI f7b50c48ef Add docker to image_schema on glance v2 cli
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
2015-12-25 12:28:55 +00:00
Jake Yip d6b0a5726e Fix tests for image-create
image-create unit tests still checks for obsolete v1 params --location
and --copy-from

remove checking of these params

Closes-bug: 1521044

Change-Id: I75ae1a200ab319b7fb818b4ccfe784af5ef8ff88
2015-11-30 14:41:24 +11:00
Darja Shakhray bff356ed73 Added reactivate/deactivate image using CLI
Added commands 'glance image-reactivate image_id'
and 'glance image-deactivate image_id' for
reactivate/deactivate image using CLI

DocImpact

Change-Id: I2c370c6bf6ff664d94d756cc76aaa983fbdb8869
Closes-bug: #1508356
2015-11-02 14:00:38 +00:00
wangxiyuan bf02b048bf Support image deletion in batches in v2
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
2015-10-10 10:18:02 +08:00
Jenkins d90c7d6896 Merge "Use dictionary literal for dictionary creation" 2015-10-09 21:11:42 +00:00
Jenkins c567edc2b2 Merge "Added unit tests for 'Unicode support shell client'" 2015-10-09 16:20:37 +00:00
Darja Shakhray abf0381e36 Added unit tests for 'Unicode support shell client'
Added unit tests for https://review.openstack.org/#/c/206037/

Change-Id: I78369fadeb8fee6434a4d5d9ded7e9e877043487
Closes-bug: #1499390
2015-09-28 12:24:23 +03:00
Ankit Agrawal 557acb1815 Use dictionary literal for dictionary creation
Dictionary creation could be rewritten as a dictionary literal.
for example:

expect_namespace = {}
expect_namespace['namespace'] = 'MyNamespace'
expect_namespace['protected'] = True

could be rewritten as

expect_namespace = {
    'namespace': 'MyNamespace',
    'protected': True
}

TrivialFix

Change-Id: I76265c26861916ed01cadb62e9201aa871183566
2015-09-24 06:31:32 -07:00
Flavio Percoco b8a881f5ea Don't get the image before deleting it
The client currently downloads the image metadata to check if it's deleted
or not. This logic belongs to the server and it's already implemented
there. Instead of getting the image, send the delete request and catch
the 404 error, which is already raised by the server.

Change-Id: I1e6ef42340f8e380ff99b9d6ca7ea416e0eebfbc
Closes-bug: #1496305
2015-09-16 09:34:34 +00:00
Gorka Eguileor 8d118ccedc Require disk and container format on image-create
Currently glanceclient doesn't enforce disk-format or container-format
presence in the command line on image-create when providing image data
(with --file, --location, --copy-from), which means that the POST
request is made with the whole image and error is reported by Glance
API.

This post enforces presence of those arguments when image data is
provided so we can get the error quicker and avoid sending unnecessary
data over the network.

Change-Id: I5914fa9cfef190a028b374005adbf3a804b1b677
Closes-Bug: #1309272
2015-08-14 09:59:17 +02:00
Jenkins 8af084d5a3 Merge "Support for Metadata Definition Catalog for Tags" 2015-08-06 16:08:04 +00:00
Darja Shakhray ec0f2dfd85 Enable flake8 checks
This commit enables new flake8 checks:
* E265  block comment should start with '# '
* H405  multi line docstring summary not separated with an empty line
* E123  closing bracket does not match indentation of opening bracket's line
* H238  old style class declaration, use new style (inherit from `object`)
* E128  continuation line under-indented for visual indent
and makes related changes in the code.

Change-Id: Ie993afc930f6b74d7a990bcaa9fc0e9f5ba1585c
2015-07-21 17:08:27 +03:00
Wayne Okuma c0e90fa2bd Support for Metadata Definition Catalog for Tags
This set provides API and shell commands support for:
- CRUD on metadef_tags;

Change-Id: I09bdf43edee6fff615d223f1a6df7c15a1e40565
Implements: blueprint metadefs-tags-cli
DocImpact
2015-07-16 14:00:50 -07:00
rico.lin e976032a95 Remove usage of assert_called_once on Mock objects
mock 1.1.0 was released on 10 July 2015 which prevents users from using
non-existent assertion methods. This broke the test in the diff.

Co-Authored-By: Ian Cordasco <graffatcolmingov@gmail.com>
Closes-Bug: #1473454
Change-Id: I162b76bbd7d96c96787a8dd8f9642ca1c80c596a
2015-07-10 15:57:51 -05:00
Cindy Pallares 6cb26fc2bf Include owner and status option in v2 image list
Show the owner and status information when adding -v or --verbose
to the image-list command.

Closes-bug: #1381514
Change-Id: I90bf622147b12ed157072fad0823af58223caf91
2015-05-22 01:56:42 -05:00
Stuart McLaren f2a8a520e7 Move unit tests to standard directory
This patch moves the glanceclient unit tests to the standard directory
(xxxclient/tests/unit) in preparation for adding functional gate tests
'check-glanceclient-dsvm-functional' in the same vein as existing client
tests for other projects, eg:

* check-novaclient-dsvm-functional
* check-keystoneclient-dsvm-functional
* check-neutronclient-dsvm-functional

Change-Id: I29d4b9e3a428c851575ee9afde40d6df583456c4
2015-04-18 17:42:20 +00:00