The following warning is emitted for every nova command using devstack,
stable/ocata.
site-packages/novaclient/client.py:278:
UserWarning: The 'tenant_id' argument is deprecated in Ocata and
its use may result in errors in future releases. As 'project_id'
is provided, the 'tenant_id' argument will be ignored.
See the following commit for related changes:
Clarify meaning of project_id var
9bbe5a87b7df62a7962debba5db7c96555da6761
Change-Id: Ifa5ed16f10a43c9961e98b03fc0535e12d7977ba
To be able to create profiling traces for Nova, client should be
able to send special HTTP header that contains trace info.
This patch is also important to be able to make cross project
traces. (Typical case heat calls nova via python client, if
profiler is initialized in heat, nova client will add extra
header, that will be parsed by special osprofiler middleware in nova
api.)
Security considerations: trace information is signed by one of the
HMAC keys that are set in nova.conf. So only person who knows HMAC key
is able to send proper header.
oslo-spec: https://review.openstack.org/#/c/103825/
Based on: https://review.openstack.org/#/c/105089/
Co-Authored-By: Dina Belova <dbelova@mirantis.com>
Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Co-Authored-By: Tovin Seven <vinhnt@vn.fujitsu.com>
Partially implements: blueprint osprofiler-support-in-nova
Depends-On: I82d2badc8c1fcec27c3fce7c3c20e0f3b76414f1
Change-Id: I56ce4b547230e475854994c9d2249ef90e5b656c
Since all authentication plugins should be stored in Keystone, there is no
need to share responsibility for authentication stuff with Keystone team.
Let's use convinient and the right way to use keystone - keystone sessions.
We have own adapter for it - novaclient.client.Session which can be used in
100% cases of novaclient usage. Let's create session object if it is not
transmitted via arguments and get rid of novaclient.client.HTTPClient
implementation.
NOTE: novaclient.client.HTTPClient and all related code will be removed
separately.
Co-Authored-By: Clenimar Filemon <clenimar@lsd.ufcg.edu.br>
Change-Id: Ibb99fdafbf02b3e92f1a5d04d168151b3400b901
We need cert, project_domain_id, project_domain_name, user_domain_id,
user_domain_name arguments to constract SessionClient in proper way.
These variables will be used in further patches
Change-Id: I44416de7f4dc18916aecb6884158b416e696227e
Meaning of project_id (argument of novaclient.client) was not clear.
In different cases, it can be tenant/project id or name (in terms of
Keystone).
* tenant_id - this variable is deprecated now and project_id should be
used instead;
* project_id - meaning of this variable is clarified now and it expects
Project ID (in terms of keystone) now.
Change-Id: Ie3fc6b50260203c0debe8664bb87a7d72fb645d7
* there are two terms in openstack which describes the same thing:
bypass_url and endpoint_override
* endpoint_override is more wide term. It is used in Keystone)
* since not all openstack folks knows that bypass_url and endpoint_override
are the same, bypass_url (variable which was used in novaclient) was not
transmitted to SessionClient
NOTE: name of variable in inner class HTTPClient was not changed, since
this class will be abandoned soon.
Change-Id: I2d45820c01851b271de8ea66e0d59ec494040c04
novaclient can't process the resource if the name is 'help',
like 'nova show help', 'nova flavor-show help', 'nova delete help',
etc. We should encourage user to use 'nova help xxxx' to show
subcommand usage, rather than 'nova xxxx help`.
Change-Id: I65204a908dc2378b6264297ddd87fcb8912a5770
Closes-Bug: #1641048
The support for non-keystone auth systems and plugins
was deprecated with 1f11840dd84f3570330d1fcd53d1e8eea5ff7922
back in the 3.1.0 release in mitaka.
Now that we're working on shoring up the support for
keystone auth sessions in the client and eventually moving
to remove support for the non-session HTTPClient, we should
also remove the support to load non-keystone auth plugins.
The whole concept of non-keystone auth systems/plugins is
a legacy artifact and is a barrier to interoperability which
is a goal of nova and OpenStack in general.
Change-Id: Ia649db257c416ca054977812ecb3f1a8044fa584
Used '%' instead of format() because "%" formatting operation
returns a unicode string for both unicode and non-unicode
format strings.
Encoded the exception error message in novaclient.shell.main and
novaclient.utils.do_action_on_many method to avoid
"UnicodeEncodeError" and print valid message.
NOTE:
Not used u'{0}.format(<str>) because in python 3 everything
is unicode so no need to add explicit 'u' to format string.
Closes-Bug: #1403379
Change-Id: I13f1ef2e1b41299b417cad3759a5cda241890df7
We just released novaclient 5.0.0 so this fixes the deprecation
message for the --volume-service-name option, not only for the
version but also the timeline for removal (to be consistent with
other things we'll remove like image and baremetal proxies).
Change-Id: I138f0ff05861a18b74cff650ea72f38d80a247fb
Parameter insecure is read using env parameter
NOVACLIENT_INSECURE, this could be string, and
string is handled as True in the rest code,
which is not correct, we should transform it
into boolean to handle it correctly.
Change-Id: I536763e45b8399b394c7dfa92d327bb4bfaa509f
Closes-bug: #1602076
Clean up all deprecated CLI options that are marked to
be removed in version 3.3.0 as we are already in
version 4.0.0
Change-Id: Ia9c5602df1be987e7c12f625d4f8359590678a19
The `--volume-service-name` name option needs to be deprecated
since the volume proxy API and CLI have been deprecated.
Change-Id: I8af9b62e56c5ab7bffa79b2700b3c9213aaad65d
Closes-Bug: 1570593
Current implementation of novaclient.api_versions.wraps allow to use
versioned methods for shell functions and resource managers. As resource
managers can have versioned methods, resource objects can have it too, but
it was not implemented yet. This patch fixes this omission.
Changes:
- Add api_version property to base resource class. It is mapped to
api_version property of manager class;
- Move `novaclient.utils.generate_function_name` to
`novaclient.api_versions._generate_function_name`, since this method is
specific to microversion stuff and should not used outside api_versions
module;
- Rewrite _generate_function_name to handle class(owner) name. Previously,
it was improssible to have two classes in one module with versioned
methods with equal names.
- Remove call of generate_function_name from novaclient.shell. Shell module
should not take care about function identifiers. get_substitutions accepts
object with __id__ property now.
- Mark _add_substitution as private method, since it should not be used
outside api_versions module
- Split all versioned methods of Server resource from novaclient.v2.servers
module.
Change-Id: Icfce16bfa6f919d7f8451d592f4a8e276b1f1709
Add the function to log 'x-openstack-request-id' or
'x-compute-request-id' in each API call.
If the caller (e.g. heat) uses oslo.log,
the caller's request id in oslo.context and
the callee's request id can be output in the same
log message (same line).
Change-Id: I29312ce278ecfae41a688a0ddf76c24cfa0eaf6b
Implements: blueprint log-request-id
Keystone V3 requires that the options os_user_domain_id/os_user_domain_name
and os_project_domain_id/os_project_domain_name be set. These options do not
have default values and novaclient will fail if they are not set by user.
This patch adds default values for os_project_domain_id and
os_user_domain_id in case of Keystone V3 env.
This is consistent with what the OpenStack CLI does.
Also, two functional tests are added to check authentication via
Keystone V2 and V3.
Partial-Bug: #1522402
Change-Id: Ieb41a7fbf24107f7250ef34218604fba96531195
The 'positive_non_zero_float' method has not been used
since Ifc9ddc08614e28358229db84cb9b54552ca36d51.
TrivialFix
Change-Id: Ice0c8f15dbc1a027710e0ace6c8fa872b964c3b6
We can use novaclient/utils directly and get rid
of openstack/common folder.
This is the first part.
Change-Id: Iaec234fbcf4d0f8c7e8f2175eae11d3083a62090
Partial-Bug: #1551603
If command has arguments with one name, but for different versions(see an
example below), both arguments will be displayed. This patch fixes this
issue.
Example of arguments:
@cliutils.args("name",
help="Name of a good action.",
start_version="2.1",
end_version="2.20")
@cliutils.args("name",
help="Name of a very good action.",
start_version="2.21")
def do_something_good(cs, args):
pass
Example of helpoutput before patch:
Positional arguments:
<name> Name of a good action. (Supported by API versions '2.0' - '2.20')
<name> Name of a very good action. (Supported by API versions '2.21' -
'2.latest')
Change-Id: I59f155675e2aae642a5b90cb70008eb5647ffe79
We have had deprecated command line options in novaclient for a long
time, but no warnings about the deprecations were ever emitted, despite
the help text being suppressed. It would be nice to finally get rid of
those deprecated options. This change sets up the precondition to
accomplish this, by emitting appropriate warnings when a deprecated
option is used.
Note: The "use" text for the deprecated options has been deliberately
chosen to reduce the number of translations required.
Change-Id: Ibe13faa56c5abca97f85f9c5172ef5a5591b5f71
Reviewing the import of novaclient 3.1.0 into the CLI Reference (change
Ib39cdfdd563a2a53f0e6de1f8d2dc4f8c4678c15), a few inconsistencies where
found and fixed:
* Missing "." at end of help string
* Inconsistent capitalization of "DEPRECATED, use"
* Inconsistent capitalization of "Set or delete"
* It's IPv4 and IPv6
* It's ID
Change-Id: I425cd6575ca31efd92fc7f0be6192031886fcc41
oslo-incubator was deprecated and all modules used by novaclient were
removed from oslo-incubator master branch. This patch removes all unused
code from novaclient's repo.
Change-Id: Ie3c542d19da6ed4d25ec490faf6a86a82f48cd34
As a stepping stone to the os-client-config patch, first switch to
using keystoneauth, its Session and its argparse registration and
plugin loading to sort out any issues with that level of plumbing.
The next patch will layer on the ability to use os-client-config
for argument processing and client construction.
Change-Id: Id681e5eb56b47d06000620f7c92c9b0c5f8d4408
novaclient should display help message of the proper versioned method
(based on api_version value).
Closes-Bug: #1523649
Closes-Bug: #1523651
Change-Id: I67f7fc2befde9d312400e9a1569e590bd763156e
Commit d045019f0f2d28f26730b3617f7d7b993506b6e8 use the variables
API_MAX_VERSION and DEFAULT_OS_COMPUTE_API_VERSION with wrong way.
API_MAX_VERSION means the max version of client supported. This
variable only be changed when client support the new version. And
it's must bumped sequentially.
DEFAULT_OS_COMPUTE_API_VERSION is default value of option
'--os-compute-api-version', this value decided the default behaviour
of nova client. The nova client CLI behaviour should be that client
negotiate with server side to find out most recent version betweeyn
client and server. So the value should be '2.latest'. And it won't
be changed except we decided to change the default behaviour of nova
client CLI.
Change-Id: Iba9bfa136245bd2899c427ac0c231a30c00bd7f3
Closes-Bug: #1508244
The client currently implements support for microversions 2.2, 2.4 and
2.11.
According the nova API microversion history:
http://docs.openstack.org/developer/nova/api_microversion_history.html
2.3 just returns extra attributes in the response so it's not a problem
for the client. We should expose those at some point but it's not a
breaking change.
2.5 is a server-side only change since the client allows filtering
servers by IPv6 address but the server wasn't honoring that until 2.5.
There are no client side changes for that microversion.
2.6 is the first backwards incompatible microversion since it replaces
the old specific console APIs (RDP/serial/SPICE/VNC) with a new generic
remote-consoles API. The client must be updated to handle this since
requesting any microversion >=2.6 for consoles will fail right now. This
is exposed on the CLI right now because the CLI defaults to the 2.latest
microversion.
So even though the client actually supports the 2.11 microversion, we
shouldn't default to higher than 2.5 because we have gaps in handling
2.6->2.10.
This change fixes the default for the CLI by setting
DEFAULT_OS_COMPUTE_API_VERSION=2.5.
Partial-Bug: #1500688
Change-Id: I52074f9a3e7faa6a7a51c3fa9766100acf25dee2
For consistency:
* Adjust capitalization, e.g. use ID or UUID.
* Slight wording improvements.
* Add "." at end of all strings.
Change-Id: I252c023438c4fe82873a1616b36391f2a2048853
CLI-Reference generator requires
(openstack-doc-tools/bin/doc-tools-update-cli-reference)
that command line help and bash-completion running without authentication.
For this purpose, remove authentication check in command and its test.
Fix nova bash-completion works without authentication.
Fix nova bash-completion test without setting authentication infomation.
Define skip_auth for descriminate "nova bash-completion" and do_help.
Change-Id: Ic1a7f84b1b9cb7e8be6721c1b8096f49e9e9ab33
Closes-Bug: #1495424
shell.main() uses safe_encode() to encode the exception name and
exception message. On Python 3, it displays:
ERROR (b'Exception'): b'message'
instead of:
ERROR (Exception): message
Don't encode exception name and message on Python 3. Use
exception_to_unicode() of oslo_utils.encodeutils to get the exception
message as Unicode. On Python 2, let print() encodes the Unicode to
the encoding of sys.stderr.
Blueprint nova-python3
Change-Id: Ib5568546d2aedb2b28c05d840b9ba34f697384ec
os_password is not set anywhere for auth_plugins. It is only set for
keystone sessions. This makes sure that it gets set before being passed
to Client.
Closes-Bug: #1493977
Change-Id: I94421fd6fa58be391dfe8a9a14479bb4c17c5231
Since heat already patched to use discover_extensions [1],
_discover_extensions is no longer used by any other project, it
could be safely removed.
[1]: https://review.openstack.org/#/c/180812/
Change-Id: If527e15dcb9fb19cf9440084f50a2c6551cbd3b3
It would be nice to use "latest" version of api by default.
Related to bp api-microversion-support
Change-Id: Ife981c87d32011f01fcbdf871071a9d8273ebb92
This patch adds version discovery when user request with latest version.
The latest version means the most recently version between server and
client.
Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I0b7a95e77371aef6e349bf54b5dd6ce6c6d2732c
New decorator "novaclient.api_versions.wraps" replaces original method with
substitution. This substitution searches for methods which desire specified
api version.
Also, this patch updates novaclient shell to discover versioned methods and
arguments.
Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I1939c19664e58e2def684380d64c465dc1cfc132
When debug logging is enabled, set the log level of iso8601 to WARNING
to effectively silence its logging.
Change-Id: I17d7e6d5776b2369a2f8c42fd88f6c6790ad1b80
Closes-bug: #1441639
Compute API version will be transmitted to API side via
X-OpenStack-Nova-API-Version header, if minor part of version is presented.
New module "novaclient.api_versions" was added as storage for all api versions
related functions, classes, variables and etc.
`novaclient.api_versions.APIVersion` class is similar to
`nova.api.openstack.api_version_request.APIVersionRequest`. The main
difference relates to compare methods(method `cmp` is missed from Py3) and
processing "latest" version.
Related to bp api-microversion-support
Change-Id: I0e6574ddaec11fdd053a49adb6b9de9056d0fbac
The client.keyring_saver attribute was not being reliably set so the
client._save_keys function was not storing any new tokens in the
keyring.
Add a unit test to ensure keyring_saver is being property set.
Closes-Bug: #1397732
Change-Id: If0df24c819d71b4df302309d049079a867a11c76