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
assertTrue(isinstance(A, B)) or assertEqual(type(A), B) in tests
should be replaced by assertIsInstance(A, B) provided by testtools.
Change-Id: I7135d3b7fe15b16c17b7581e553ce5d289b58f43
Related-bug: #1268480
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
Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.
Change-Id: I384fbe8722af07bcaa4e2610384446751a8072bf
Closes-bug: #1280522
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
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
The __eq__ of apiclient.base.Resource will return True,
if the two objects have same id, even if they have different
other attributes value. The behavior is weird and don't
match the semantics of object equal. The objects that have
different value should be different objects.
Fix this issue and add some test cases in this patch.
Change-Id: I24ba39bf90d727116f256de46241746520efbfee
Closes-Bug: #1499369
We need all the headers to be safe strings so they can be joined
together and not become an unicode string in doing so.
This fixes a bug when creating an image with non-ascii characters in the
name.
This is required for python 2.6 compatibility.
Change-Id: I66ebc27edf4ccd8f903399da58705711c372536d
Closes-Bug: 1448080
devstack produces a file called clouds.yaml already with credentials in
it. Rather than producing our own config file to run functional tests,
just consume the clouds.yaml file that's already there.
Closes-Bug: #1507386
Change-Id: I82c071b2cd903b9578d1f2ec515882c815812692
Pass the subcomand's arguments instead of the base ones to the endpoint
creation call when quering the `/versions` endpoint. Passing the wrong
arguments will end in the auth_requirement not being identified and an
error 'Expected Endpoint' will be raised as no endpoint will be gotten
from keystone.
This patch also removes an unnecessary mock in the test code related to
this fix.
Depends-On Iefeb9bc123f8c65fecd0cba585ecd3eb349b23a6
Change-Id: I46088130b9175798e3719e43f48dc474fbc8a251
Closes-bug: #1504058
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
When running just 'glance' under python3, we will get the error:
ERROR: 'Namespace' object has no attribute 'func'
This is because map() is used to decode sys.argv, but under Python3
it returns a map object which is an iterable. Some code later tries
to use this in a boolean context and it will always return True,
even if it's empty.
Change-Id: I2f03e462cb813833b75b9f2de7badd10b10cddff
Closes-Bug: #1295356
The latest change to the auth_required logic introduced a bug were even
when the token and endpoint were passed, authentication was being
required.
This patch fixes that issue and makes sure that authentication is not
required when these 2 arguements are present.
Closes-bug: #1499540
Change-Id: I4c9c15ba526378970da5461511ed922d42c5a9f9
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
The oslo.utils function has exception_to_unicode that can
replace glance util function exception_to_str.
So we don't to have this exception_to_str function in glance
anymore.
Change-Id: I332bc55558087920fdd6ae2d822bece5166f5ba6
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
If CLI client is called without any subcommands or arguments it will
fail with """'Namespace' object has no attribute 'command'""". This
is coming from the getattr which does not have alternate value
specified.
Closes-Bug: #1494259
Change-Id: I461f0d4a91f3af2224bafc14a88572a8e4a3c051
The `help` command was behaving a bit funky. This patch re-orders the
code a bit so that the `help` command will be parsed at the very
beginning before running other commands and checks.
It also allows to get help without downloading/checking schemas and
without requiring auth credentials (previously required by the schema
operations).
Change-Id: Ib7b10d4d80f15e6b75bb8644d7d916bef09413d6
Closes-bug: #1490457
Add parsing the endpoint URL and check the path string only
in order to decide the API version.
Change-Id: Ib0a035f3bed31e2162a1231a5f5dcc3907d37243
Closes-Bug: #1489727