Commit Graph

24 Commits

Author SHA1 Message Date
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
Jenkins 17375a422c Merge "V2: Do not validate image schema when listing" 2015-08-20 17:28:21 +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
Stuart McLaren 43769d6cc7 V2: Do not validate image schema when listing
Previously when listing images via v2, the first image of each batch
was validated against the v2 schema.

This could lead to unpredictable behaviour where a particular image
which failed the schema check may or may not be the first of a batch.

In some cases it also meant that operation by one user could affect the
ability of another other to list images.

Change-Id: I22974a3e3d9cbdd254099780752ae45ff2a557af
Closes-bug: 1477910
2015-08-10 10:24:57 +00: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
Kamil Rykowski d9d586942b Extend unittests coverage for v2 tasks module
Add new tests for v2 tasks module to cover following cases:
- getting list of tasks using the marker
- getting list of tasks using sort_key & sort_dir keys

Change-Id: Ic126999ebb16e51cc472fe8f86dfe1fced0bc016
Closes-Bug: 1433637
2015-07-20 07:25:45 +00: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
Jenkins cc38f51086 Merge "Add v2 support for the marker attribute" 2015-06-22 04:52:27 +00:00
Brad Pokorny ea01f13be2 Add v2 support for the marker attribute
The v2 Glance client implementation ignores the marker attribute if
it's passed to the client as part of the kwargs.  Include support
for the attribute, as the v1 client supports it and it makes it
easier to work with the Glance client.

Change-Id: Ifaa59129bc4178212b890ea591673cb154e0f110
Closes-bug: 1465373
2015-06-19 15:03:37 -07:00
Cindy Pallares 997c12d3ab Import only modules and update tox.ini
As stated in the OpenStack Hacking Guidelines, it is prefered
that only modules should be imported.

Also updated tox.ini to ignore opestack/common among others.

Change-Id: I2f0a603c31052eadee581c11880c0ec6bd392829
2015-06-17 10:56:37 -05:00
Jenkins 064822181a Merge "Fix Metadef Object update issue with python-glanceclient" 2015-05-26 14:59:51 +00:00
Jenkins 85078098e7 Merge "Use assertIn instead of assertTrue in tests" 2015-05-26 09:55:18 +00:00
Jenkins 0bf3bfe94f Merge "Unorder compare in tests" 2015-05-26 01:29:03 +00: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
Lakshmi N Sampath 5d933b0dd5 Fix Metadef Object update issue with python-glanceclient
Disallowed fields(schema, created_at and updated_at) were
getting deleted from Metadef namespace instead of Metadef object.

Change-Id: Id80e204c7af1ac6926c66627d290a15c4e6b00d9
Closes-Bug: #1433884
2015-05-18 13:49:52 +02:00
Kamil Rykowski bf413a6539 Use assertIn instead of assertTrue in tests
Since `assertIn` is provided for checking if value exists in given
container, it is not formal to use `assertTrue` for it.

Change-Id: Ie1392839b5ca436957463bb29f2784d48cfcbf75
2015-04-29 10:31:22 +02:00
Jamie Lennox 6431fae545 Unorder compare in tests
On occassion the values from schema are presented in a different order.
Compare them in an unordered way as we only care that both are present.

Change-Id: Ib2d44587196f43c73f4b0a3796fac9f4dc20f20f
2015-04-29 04:12:35 +10: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