Commit Graph

836 Commits

Author SHA1 Message Date
Jenkins 8687b05ea0 Merge "Use the subcomand parsed args instead of the base" 2015-10-14 11:04:06 +00:00
OpenStack Proposal Bot 3bd28bf562 Updated from global requirements
Change-Id: Ieb2ffb702354dfb31c45fbc6c28b9e48dc479d60
2015-10-13 11:04:30 +00:00
Flavio Percoco 36937bbf63 Use the subcomand parsed args instead of the base
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
2015-10-12 17:05:55 +09:00
Jenkins eab2a9da93 Merge "Stop trying to send image_size to the server" 2015-10-11 11:10:35 +00:00
Jenkins 3ec7c8337f Merge "Do not use openstack.common.i18n in glance client" 2015-10-10 18:59:59 +00:00
Monty Taylor afd1810c12 Stop trying to send image_size to the server
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
2015-10-10 12:59:53 +00: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
OpenStack Proposal Bot 77012ee670 Updated from global requirements
Change-Id: I99290470cc6ddc1079b7d72a24558ba352631203
2015-10-09 05:04:17 +00:00
Jenkins 542941cef0 Merge "Fix Typos in comments" 2015-09-30 18:34:02 +00:00
Jenkins 0b049315ea Merge "Updated from global requirements" 2015-09-30 18:26:00 +00:00
Jenkins 8c0c3c9ed4 Merge "Replace exception_to_str with oslo.utils function" 2015-09-30 18:10:40 +00:00
OpenStack Proposal Bot 603697a325 Updated from global requirements
Change-Id: Ib81815a6f0d5a07e28d832f199fd993dd7dd6759
2015-09-29 17:56:14 +00:00
kairat_kushaev df0f6642e5 Do not use openstack.common.i18n in glance client
i18n library is present in openstack.common but we also have
glanceclient module that supports the same functionality.
In order to be consistent and exclude dependencies on
oslo-incubator code we need to use glanceclient.i18n module only.

Change-Id: Iae9722d7903034bfa6fb8afadbb1f1292c29203e
2015-09-29 14:16:27 +03:00
Jenkins a98ed22091 Merge "Add check Identity validate when get schemas" 2015-09-29 08:22:41 +00:00
Jenkins 385085eb55 Merge "Fix human readable when size is None" 2015-09-28 11:49:14 +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
Jenkins 5eaa52eae4 Merge "No auth when token and endpoint are passed" 2015-09-25 17:12:18 +00:00
Jenkins 6e7c64bd5b Merge "Add period in help message" 2015-09-25 16:48:54 +00:00
Flavio Percoco c31c136557 No auth when token and endpoint are passed
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
2015-09-25 10:59:54 +02: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
kairat_kushaev c6addc722c Replace exception_to_str with oslo.utils function
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
2015-09-22 15:40:02 +03:00
Monty Taylor 586d40131d Change ignore-errors to ignore_errors
Needed for coverage 4.0

Change-Id: Iffb28d5676a7cf9bfb8c7a103e8677885fd07dba
2015-09-21 14:53:12 +00:00
Atsushi SAKAI 05cd0c7508 Add period in help message
Command help message uses help and CLI-Reference generation.
  and in convention, help message stops with period ".".

Change-Id: I652afdb5e4d69a0476a0a2dc313ae60ece3b7bbc
2015-09-19 17:27:14 +00:00
Jenkins 9f8163ec82 Merge "Don't get the image before deleting it" 2015-09-18 10:03:27 +00:00
Jenkins 3651d5c02e Merge "Add parsing the endpoint URL" 2015-09-16 18:14:29 +00: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
Stuart McLaren 3d3d8296c4 Fix human readable when size is None
If an image size is null don't stack trace when listing.

Change-Id: Iba18470edbe032d1d01380372d57fa17adef5f7e
Closes-bug: 1495632
2015-09-14 17:27:43 +00:00
Erno Kuvaja 86635868c1 Change next version in docs
As stated by Doug we need to release 1.1.0 instead of 1.0.1
https://review.openstack.org/#/c/222716/

Change-Id: Ifb24361a1d5a5270c6b3173ba28409addfec19b0
2015-09-14 15:09:55 +00:00
Jenkins d39b5864a3 Merge "Fix the remove property logic in V2" 2015-09-14 08:19:22 +00:00
Jenkins 09006c471c Merge "1.0.1 Release notes" 2015-09-11 17:19:22 +00:00
Jenkins d4e7f97e3a Merge "Fixes CLI client called without subcommands" 2015-09-11 15:22:50 +00:00
Erno Kuvaja 04a54fed14 1.0.1 Release notes
f6712f5 Print the reverting back to v1 to stderr
2c7da7c Invalid output running the command 'glance image-show <image_id>'
5026774 Don't make `help` require auth parameters
75ec903 check for None value in utils.safe_header
f0b30f4 Updated from global requirements
1322fbc Consider `--os-token` when using v2
47423eb Check if v2 is available and fallback
90b7dc4 Update path to subunit2html in post_test_hook
1e2274a Password should be prompted once

Change-Id: I70329b9596421a4d8c0c953c19759a96f29c8b0d
2015-09-11 14:58:18 +00:00
Erno Kuvaja 160825f909 Fixes CLI client called without subcommands
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
2015-09-11 12:56:08 +00:00
Jenkins 2c800e5134 Merge "Updates default --sort behaviour" 2015-09-10 11:52:07 +00:00
Jenkins 337b2dce72 Merge "Invalid output running the command 'glance image-show <image_id>'" 2015-09-10 08:06:09 +00:00
Erno Kuvaja f6712f5d33 Print the reverting back to v1 to stderr
Printing to stderr to fix the download issue.

Change-Id: I2916bb100ac451378db82291855078f2b37466bd
Closes-Bug: #1488914
2015-09-09 13:34:05 +00:00
Jake Yip c8c8964ddd Updates default --sort behaviour
When querying against a Juno glance-registry, we found that having the
--sort option defaulting to 'name:asc" results in querying the registry
with additional SQL parameters like the following:

WHERE image_properties_2.name = :name_1 AND image_properties_2.value =
:value_1

as a result of handling the newer 'sort' filter. This results in a
blank list being returned as the output of glance image-list.

This patch sets the --sort-key and --sort-dir instead of --sort when
neither --sort-key nor --sort-dir are specified, so as to maintain
backwards compatibility with Juno glance-registry.

Change-Id: I8bd64cca7f1b7abdbabf4c09e3dbbcb4044e51b4
Closes-bug: #1492887
2015-09-09 22:44:08 +10:00
David Sariel 2c7da7cb60 Invalid output running the command 'glance image-show <image_id>'
Running the command returns the string 'id' and fails on exception.
In function _image_meta_from_headers the meta variable was not properly
set because key was not lowercased. Converting key to lowercase solves
the problem.

NOTE: this is a compatibility fix for urllib3 >= 1.11

Closes-Bug: #1487645
Co-Authored-by: Flavio Percoco <flavio@redhat.com>
Change-Id: I1b0b327163577585becb5e762536058d21dc1c98
2015-09-09 14:35:59 +02:00
Flavio Percoco 5026774bd1 Don't make help require auth parameters
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
2015-09-09 10:47:13 +00:00
Jenkins 5507d84901 Merge "Consider --os-token when using v2" 2015-09-08 21:01:04 +00:00
Jenkins f387929878 Merge "Check if v2 is available and fallback" 2015-09-08 20:45:52 +00:00
Takashi NATSUME 19480df10a Add parsing the endpoint URL
Add parsing the endpoint URL and check the path string only
in order to decide the API version.

Change-Id: Ib0a035f3bed31e2162a1231a5f5dcc3907d37243
Closes-Bug: #1489727
2015-09-08 20:52:45 +09:00
Jenkins aa4cd9dc4b Merge "check for None value in utils.safe_header" 2015-09-08 08:23:47 +00:00
David Edery 75ec9033c2 check for None value in utils.safe_header
In case that a sensetive header (that should be obscured by its SHA1
hash) is None, the safe_header throws an exception which fails the
calling process and by that may harm the functionality.

Change-Id: I56944a382fd546eba0a6dd6d6b1cecf83b1dc106
Closes-Bug: #1491311
2015-09-08 00:24:36 +03:00
OpenStack Proposal Bot f0b30f4ff2 Updated from global requirements
Change-Id: I88e5d1c0cc29a94cbe958e20557e16e1a12c1e2b
2015-09-04 19:40:48 +00:00
Flavio Percoco 1322fbc5d8 Consider --os-token when using v2
The `_cache_schemas` call currently forces authentication even when the
`auth_token` and `os_image_url` are passed. Instead of handling forced
authentications, let the client use the passed arguments and
authenticate only once if needed.

This was not caught by the existing tests because the call to
`_cache_schemas` was mocked.

Change-Id: I93cec9a68cafc0992d14dab38114d03e25f1e5da
Closes-bug: #1490462
2015-09-04 13:31:55 +02:00
Flavio Percoco 47423ebbb2 Check if v2 is available and fallback
We have a basic implementation for a fallback mechanism that will use v1
rather than v2 when downloading schema files from glance-api fails.
However, this is not sound. If the schemas are cached already, we won't
check if v2 is available and fail to fallback.

This patch fixes the aforementioned issue by getting the list of
available versions from the server only when the API versions was not
explicitly specified through the CLI. That is, for all commands that
don't pass `--os-image-api-version 2`, we'll check v2's availability and
we'll fallback to v1 if it isn't available.

This patch also changes how we handle `/versions` calls in the client.
The server has been, incorrectly, replying to requests to `/version`
with a 300 error, which ended up in the client re-raising such
exception. While I think 300 shouldn't raise an exception, I think we
should handle that in a spearate patch. Therefore, this patch just
avoids raising such exception when `/version` is explicitly called.

This fallback behaviour and the check on `/versions` will be removed in
future versions of the client. The later depends on this bug[0] being
fixed.

[0] https://bugs.launchpad.net/glance/+bug/1491350

Closes-bug: #1489381
Change-Id: Ibeba6bc86db2a97b8a2b4bd042248464cd792e5e
2015-09-04 13:31:55 +02:00
Takashi NATSUME 90b7dc4141 Update path to subunit2html in post_test_hook
Per:

http://lists.openstack.org/pipermail/openstack-dev/2015-August/072982.html

The location of subunit2html changed on the images in the gate
so update the path used in the post_test_hook.

Long-term we should just use what's in devstack-gate.

Change-Id: I142b3c0590ba2fa880973b0ee306ebd1db27fd03
Closes-Bug: #1491646
2015-09-04 10:29:01 +09:00
Cindy Pallares 0869196ca2 Fix the remove property logic in V2
The check used to verify if there are any properties to remove in the V2
image-update command will always execute even if there are no properties to
remove due to the fact that it checks if remove_prop is not None, when it is
actually a list and not a None value.

Closes-Bug: #1475053
Change-Id: Ia36e945b880de3514c73073a392bdb7dde13cf84
2015-09-02 12:20:23 -05:00