Added new private method to log request-id of each api call
for both SessionClient and HTTPClient. Already available
ks_logger and client_logger will be used for SessionClient
and HTTPClient respectively.
Change-Id: I679c57b96071ecd9bcd1ab2ed50692195586ca52
Implements: blueprint log-request-id
Currently we can specify a client certificate key using --os-key option
inherited from keystoneclient cli options but it has no effect because
keystoneclient Session expects as cert argument, one of the followings:
* None (no client certificate),
* a path to client certificate,
* a tuple with client certificate/key paths.
The change updates cinderclient code to support the last case (ie:
os_cert and os_key are non-empty) in order to take into --os-key option
and OS_KEY environment variable.
Closes-Bug: #1564646
Change-Id: I258fd554ad2d6a5413ffe778acefa3a0b83e591f
Changes to cinderclient to use microversions.
Implements: blueprint api-microversion-support-for-cinderclient
api-microversion-support-for-cinderclient
Change-Id: I840a1162b88e8ff36fa3fc4e1d6b9317104df3e0
Add support for Cinder API /v3 endpoint.
A couple of unit tests for /v3 endpoint were added to v3/test_shell.py
to ensure that the v3 shell works, and to also test that modules work
with:
from cinderclient.v2.availability_zones import *
syntax.
Change-Id: I6ae0ada221bebb4ab1850d9c99b10fcbb585201f
Implements: https://blueprints.launchpad.net/python-cinderclient/+spec/add-v3-endpoint-support
Graduate from Oslo Incubator to oslo.i18n library.
Cleanup of unused Oslo Incubator utils.
Added optional enable_lazy() usage.
Implements: blueprint graduate-oslo-i18n [1]
https://blueprints.launchpad.net/oslo-incubator/+spec/graduate-oslo-i18n
Change-Id: I9c8db9487b554b637a41620c858a7e7abf802879
Heat wants to use
`cinderclient.shell.OpenStackCinderShell._discover_extensions`
function (https://bugs.launchpad.net/heat/+bug/1527071),
which is private currently. It's better to change this method
to public for public use.
This change will do it as novaclient did.
Change-Id: Iaaa4cab530fd495877e15a372fff1354ddbeaa17
Closes-Bug: #1527169
We are already use Cinder API v2 by default so it sould be consistent to
use 'volumev2' service type by default
Change-Id: I9f2da310f6ad53a40d476ede62369cc364371064
With oslo-incubator being deprecated, move
our use of strutils to oslo_utils.
This leaves in place the use of oslo-incubator's
strutils by other oslo-incubator modules for now.
Change-Id: Ic4e50060b42aeca9d1e54424a8a3a123140fbf2a
Fix Change-Id: I98a8507f2369deff6a6f7f8f08271b169fe651ad for bug #1454436
doesnt allow OS_ENDPOINT_TYPE environment variable to be used as a default
for --os-endpoint-type as argparse takes the first definition of the
default expression for dest=os_endpoint_type
Closes-bug: 1500489
Change-Id: I76cc963b10bc7a549fe5a0cd2c73dfc6a30bb759
This change add a period for the description string of
a argument that gets dropped.
Closes-Bug: #1489317
Change-Id: Ica1a74625a640f8d664f5ca183ada14ef63be077
Cinder API v1.1 is deprecated and will be removed. Switching to API v2 in
cinderclient makes it works well with new API after API v1 will be
removed.
Change-Id: I639f4b54dc7e220e8e351113a4de1dff104b50a7
Keystone v3 has changed the name of tenants to projects which means that
OS_TENANT_NAME is meaningless in a cloud where v3 is the default
authentication version. As such, if a user does not have OS_TENANT_NAME
enabled, cinderclient will not work even though it has checks for v3
immediately below this check (and the same check replicated further
below that). Removing this allows cinderclient to work with Keystone v3
without setting OS_TENANT_NAME unnecessarily.
Further, the check for project information was incorrectly referring to
project_domain_name and project_domain_id instead of
os_project_domain_name and os_project_domain_id.
Closes-bug: 1472636
Change-Id: Ifabb4a2aec070c00349e794364a71394feea99f1
This reverts commit ae03d2a721bd9acb61805ce792a27fb7cf88e5cd.
Cases where a deployment is using a proxy, Cinder servers won't return
the expected publicURL, and instead gives an internal URL that the
client can't use.
Commit 2eb25ab8803214cb3beb5d8fe3efbf70a462c414 in Cinder introduces the
public_endpoint config option, but not everyone is expected to be
running that later of a version to take advantage of this.
Closes-Bug: #1464160
Change-Id: I61228c1e8630b958c792be077674b48fbdb83135
The cinderclient implemented it's own version of the CLI arguments that
are now provided by keystoneclient's session object. This changeset
converts cinder over to utilizing the shared argument registration.
Closes-Bug: 1434105
Change-Id: I72b16aab909d72a47097434436093e616667634a
pbr 1.0.1 released in 2015-05-19 requires the newer
hacking module >=0.10.0,<0.11 than the versions
specified in the test-requirement.txt file,
which causes failure in gate-python-cinderclient-pep8.
This patch bumps the pbr version in test-requirement.txt
to make it consistent with requirements repository,
and adds some fixups to avoid some new hacking rules.
Change-Id: I7de6e04e30a475ec1c26224461faf0c708178a40
Closes-Bug: #1460774
Commit for "Enable version discovery":
ae03d2a721bd9acb61805ce792a27fb7cf88e5cd
breaks CLI use of --endpoint-type. This is because we were using the
default interface instead of checking to see if an endpoint_type is
passed in.
Change-Id: I412bb6b4bcb9bf10aa6118a2ed43e28cbd3ed236
Closes-Bug: 1454407
Cinder uses the parameter '--endpoint-type' but other services
(Glance, Nova, Swift) use '--os-endpoint-type'. (Neutron has deprecated
'endpoint-type' in favor or 'os-endpoint-type' as well.
'--endpoint-type' should be deprecated and 'os-endpoint-type' should
be added.
Change-Id: I0ac6573be35c86b9f764a39f1e60486d2345f51b
Closes-Bug: #1453901
The service catalog can now have the cinder endpoint x.x.x.x:8776 with
service_type volume, without needing to specify a version in the
endpoint. Keystone will do discovery of the root / GET of the Cinder API
to discover the versions that can be talked to.
This also provides backwards compatibility for the previous solution of
having v1 enabled on service_type volume and v2 on service_type
volumev2.
Change-Id: Id0347f8370dbc8fd7fa8096cd5859e10b0c5d67c
Added a function, which parse arguments and add -- separator
after metadata subcommand
Change-Id: I907eb89209d549dcdad361d88352491110eaadb9
Closes-Bug: #1379486
A short option for --debug is a convenience.
This commit adds the -d short option as a shortcut for --debug
Glance already provides -d.
Change-Id: Iefae6cee566f9c7d7375e89c3f8603f149e555ef
Closes-Bug: #1421210
If the bypass_url is specified in the http client, there is no need
to get it from Keystone.
Change-Id: I891849f77ad2ba98a83c993b401121216c8cfff6
closes-bug: #1350702
Added functionality from keystoneclient to fallback to the tty for password
entry if no password is given via the environment or the --os-password option.
Change-Id: If5b27cb8c67712860faa24d543ed48eaa542f28b
Closes-Bug: 1357559
To be able to create profiling traces for Cinder, client should be
able to send special HTTP header that contains trace info.
This patch is as well important to be able to make cross project
traces. (Typical case nova calls cinder via python client, if
profiler is initialized in nova, cinder client will add extra
header, that will be parsed by special osprofiler middleware in cinder
api)
Don't worry no security issue here, trace information is signed by HMAC
key that is setted in api-paste.ini. So only person that knows HMAC key
is able to send proper header.
Main patch (in Cinder) is:
https://review.openstack.org/#/c/103415/
Change-Id: I53bb1b92e62841a02f941bdafaed7f8ed5db7ce1
Adding channels to a logger is not the responsibility of a library. This
sort of thing should be handled by an application so move the logging
over to the shell.
Change-Id: Ie11571d428913eba1aae5aa42a6e925228ba6808
V3Client support added version discovery and session supports. Most
of the external auth system doesn't support this. This fix bypasses
version discovery if the idenity service doesn't support that. Session
is used only if no external auth plugin is used
Change-Id: Ia84a2ad45940d35c5ef740727f5f7477c72ea9d4
Closes-Bug: #1333961
Some command-line args were deprecated in Diablo and slated for removal
in Folsom. They're being removed in Juno instead.
Change-Id: I02339ba08c997fecca5a6639382360962e668bfd
Make text consistent and clear.
Add periods to end of sentences.
Adjust test suite for change
Closes-Bug: #1275881
Change-Id: I1dfde51636e8dc4b42e4c4810c27c1c4ac513d82
Due to backward compatibility there are arguments hidden.
For example:
--tenant-id and --tenant_id
On those case the abbreviation mechanism if a user enter
--tenant throw that there is an ambiguity but the helps only
show --tenant-id as an optional argument.
This change remove this ambiguity if one of them is hidden.
Change-Id: I413f1ebafc68b3e02b5abadce1608e6d48207b01
Closes-Bug: #1252457
With CINDER_RAX_AUTH being rightfully removed, cinderclient is no longer
compatible with Rackspace/any non-keystone auth. To fix this, I stole
auth_system/auth_plugin from novaclient's implementation.
See https://review.openstack.org/#/c/23820/.
Change-Id: If5f84003f868ef02bb7eb7da67cf62018602e8f0
Closes-Bug: 1280393
get_volume_api_version_from_endpoint currently assumes that the
management_url will always be in the format of
http://<ip>:<port>/vX/<tenant_id>. Customers using a gateway, however,
can get a mangement_url in a different form like
https://<ip>:<port>/<resource>/vX/<tenant_id>. This causes the
get_volume_api_version_from_endpoint to find the resource portion of the
url when looking for the Volume API version which makes the
cinder client unusable.
To resolve this I have implemented an exception handler in the case that
get_volume_api_version_from_endpoint fails. If the exception is thrown, I
check for OS_VOLUME_API_VERSION in the environment and use the value of that
environment variable, if it is set, to determine the API version to use.
There are proposals to fix this via changes to keystone in future releases,
but this provides a way for IaaS Gateway users to proceed with Havana.
Change-Id: I8b978a6ecd87b81c6ae34938e37623ad1cc33994
Closes-Bug: 1233311
Python3 changed the behavior of dict.keys such that it is now
returns a dict_keys object, which is iterable but not indexable.
You can get the python2 result back with an explicit call to list.
Refactor list(*.keys()) so that it just uses list().
Change-Id: Ib2e9646ac967e9bd7cc4f47e2099f5d1358808a9
Signed-off-by: Chuck Short <chuck.short@canonical.com>
On Python 2.6, this results in an error like:
/usr/lib/python2.6/site-packages/cinderclient/shell.py:524:
DeprecationWarning: BaseException.message has been deprecated as of
Python 2.6
message = e.message
Should use the method from novaclient commit 8c4e145b92, which
works well with python2 and python3.
Change-Id: Ifbd78ad158ae87670bdee4e247469091efaa3260
NOTE:
* openstack/common/* should be synced from oslo, so i leave them
untouched.
* add (c) symbol for related lines, leave others untouched.
Change-Id: I46a87c7f248d3468b1fdf5661411962faf2fb875
Fixes-Bug: #1214176
Before v1 and v2 were set to the same service_type, so you could only
have one set at a time. This assumes the catalog is setup for v1
service_type 'volume' and v2 service_type 'volumev2'.
For backwards compatibility, we will allow v2 to be setup with
service_type 'volume' for existing installations.
Change-Id: Ife6d2cdb12d894b84ea3b276767fb93d487355d5