Importing pkg_resources causes the app to scan the entire import path
for all distributions, not just those providing entry points. The
scanner in stevedore will have a cache of the entry point data, making
it significantly faster. This will be especially useful in command
line programs like python-openstackclient.
Change-Id: Ic5eb9401c8ea3bd9624b818e0ffb8dcc13f61559
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
All modules of novaclient.v2.contrib have been removed.
The 'only_contrib' parameter for the
'novaclient.client.discover_extensions' method is no longer valid.
Change-Id: I6da83057dda1f27afe98a2412bc0815f100f34a4
In Ic75be3acb8b77aae8da631e3c4cd6f545a9a35cb,
'global_request_id' is set
in the constructor of class keystoneauth1.adaptor.Adapter.
But 'global_request_id' was not passed to the constructor,
'global_request_id' was cleared.
It caused the test failure.
It is not necessary to set 'global_request_id'
in the constructor of class SessionClient
and just passing 'global_request_id' in kwargs
is required.
Change-Id: Id587e35c221fe2b11889469f88557d254125ea7e
Closes-Bug: #1697358
As part of the Boston Summit, support the global_request_id effort by
making python-novaclient support passing global_request_id during
construction.
part of bp:oslo-middleware-request-id
oslo spec I65de8261746b25d45e105394f4eeb95b9cb3bd42
Change-Id: Ife29b1856c0c278eab1708c3971fef14b9d77e2e
keystoneauth supports setting additional info into the user-agent string
about what the client is. Set it so that novaclient shows up in server
logs as the client.
Change-Id: I084a16f5372ec7df598505e9f925a70d26d66f69
These were deprecated in Newton:
aaebeb05a0
Since this is the last of the deprecated contrib extensions,
we can also deprecate the 'only_contrib' parameter from the
novaclient.client.discover_extensions method.
Change-Id: Ie2e3fdc4e044f6eb304724d16a7d0f1f7ba705fd
In case of token authentication is used pass relevant parameters
to Token authenticator.
Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
Change-Id: I9a04d89016a834fe96f1b77e91011f7fa4fdda51
Closes-Bug: #1654183
In the recent release of keystoneauth1 2.18.0 provision is made to log
x-openstack-request-id for session client. Once this new library is synced
in openstack projects, the x-openstack-request-id will be logged twice
on the console if session client is used.
For example,
$ nova --debug list
DEBUG (session:640) GET call to compute for
http://10.232.48.204:8774/v2.1/servers/detail used request id
req-b6aeff56-0408-44ed-80ba-cd7b950a8f21
DEBUG (client:85) GET call to compute for
http://10.232.48.204:8774/v2.1/servers/detail used request id
req-b6aeff56-0408-44ed-80ba-cd7b950a8f21
Above log will be logged twice on the console.
Removed logging of x-openstack-request-id in case of SessionClient as it
is already logged in keystoneauth1.
Depends-On: I492b331ff3da8d0b91178bf0d5fe1d3702f15bd7
Closes-Bug: #1657351
Change-Id: I9ba6a9e498fbcb027f45499d27ece966c52580ba
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
In previous patch we switched to use SessionClient in all cases. It means that all
HTTPClient code is redundant now.
Change-Id: I5a0da970fd82c79db3d88f1b49279133bbdba639
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
HttpClient will be deprecated soon and SessionClient will be used by default.
To not break integration novaclient with other project at the step of moving
from HTTPClient, SessionClient should have similar interface.
Change-Id: I855ccc5160dc7628f4550e93bf133adf8263aace
This is the last variable which is redundant in case of SessionClient.
After this patch we will be able to use SessionClient in 100% usecases.
Change-Id: I102ba25eee7434cb66ea6efbf9ec4ab310d0957a
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
'interface' argument was not described anywhere in novaclient's docs,
but since we transmit all additional (unexpected) arguments to
SessionClient implementation, keystoneclient was able to use it.
Change-Id: Id7200a6df416694173b9a02206c53cef984f0fec
"password" term is more clear. Resolves FIXME from the code:
FIXME(comstud): Rename the api_key argument above when we
know it's not being used as keyword argument
Change-Id: I39f810a181b119591cf017eded71356a437a8c0a
* 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
Arguments 'extenstions' and 'no_cache' were not transmitted to
'_construct_http_client' method. They are redundant
Change-Id: Ibe0f874e510eef7cc28fcee87b0083c7febd5161
This patch introduces `_check_arguments` methods for processing deprecation
workflow of novaclient.client.Client entry-point.
Also, this patch adds a proper warning messages for 'auth_plugin',
'auth_system' arguments, which were removed previously
Change-Id: I7ee210c08f4126b267572c5428511451aeb17260
We have a lot of arguments in several Clients methods. Reviewing their
changes is a hard task, so let's sort them to simplify reviews.
Change-Id: Ie78773fd92017fbc4631d0fc6ae9da2e15935537
Possitional arguments doen't allow to provide proper compatibility
and deprecation workflows. *args was deprecated long time ago and a
proper message was added.
Change-Id: Ib4a8f4db52a0f4cb8e8cf5e8c8e778eef8831e91
All extensions from novaclient.v2.contrib should be not be extensions in
case of api version >=2.0;<=3.0 (historically, they are turned on by default
for cli layer), so let's move it from contrib dir and turn on by default.
Change-Id: I4ef4e44cf970947dad33110ce658a133e4f2893e
The support for non-keystone auth systems and plugins
was deprecated with 1f11840dd8
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
Refactoring code: Making 'kwargs' dict to use single instruction: pop()
rather than two instructions: get() and del, giving the codes a format
that carries through.
TrivialFix
Change-Id: Icaf4a57314a8fe48f51993d7b32a1671fec40f31
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
It is hard to deprecate or remove arguments for Client objects. We already
have several args which are not used anywhere and we need to do something
with them(clean code).
Change-Id: I2218ff0c750922a105d21a13e42f193ffd86ec01
As nova stable_api.rst indicated: As the extension will be removed
from Nove V2.1 REST API. So the concept of core API and extension
API is eliminated also. There is no difference between Nova V2.1
REST API, all of them are part of Nova stable REST API.
so we can move all extensions from contrib to core, this
patch is prelude of https://review.openstack.org/#/c/285213/ and
its following patchs.
Change-Id: Ibd5df4bcc70a4b4854fd519330d89c751f7409dc
Several OS projects(cinder, neutron, osc...) use
`novaclient.discover_extensions` for initialization novaclient.client.Client
with novaclient.v2.contrib extensions. In this case, it would be nice to
provide a way to not discover extension via python path an entry-point.
Change-Id: I030f4c55c2795c7f7973f5f12e54b9819c4a5578
Closes-Bug: #1509500
We need to check header only for nova-related calls. While we are unable to
determine nova's calls, let's just temporary disable it now and turn on it
in the future with 2.18 microversion.
Change-Id: I92cecb140fc478f0cf37783d2fcfcaccd935bdfc
NOTE: this check affects only novaclient-as-a-lib
Commit 81f8fa655c broke extension loading
from pythonpath on python 2.7 due to the removal of code that was
erroneously marked for 2.6 compatibility. Put it back.
Change-Id: Ic04f4d57953967fde9817ff5119ce0182453a86d
Closes-Bug: #1530230
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
There is a lot of H404/405 violations in novaclient, and it is better
to fix those to have a better doc string for class/methods.
This patch fixes these violations for below files-
-api_versions.py
-base.py
-client.py
As there are lot of violations and cannot be fixed in single patches,
So separating those in multiple patches for easy review.
Change-Id: I30a714fc3b0b317f7ffa4a99fbb224b4d5f5477b
Partial-Bug: #1521899
Since oslo is removing support for python 2.6, nova
needs to also remove support from clients and libraries.
This commit is to remove support from python-novaclient.
-- Python 2.6 compatibilty code was removed.
-- Python 2.6 was removed as a tox environment, install venv,
and from the classifiers in setup.cfg.
-- Release notes have been updated.
UpgradeImpact
Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
Change-Id: I3f587ff38d478d075af5fd014e2b4b8416e185d4
Closes-bug: 1518390
novaclient provides version negotiation on CLI layer. In case of usage
novaclient as a lib, user can specify api_version with microversion part
and can try communicate with Nova endpoint which doesn't support
microversions. Nova endpoint will not check X-OpenStack-Nova-API-Version
header and will execute request(it can be correct or not). It this case
we should warn user about his mistake and about "incorrect" response.
Change-Id: I7a5ab964b7b2b2a49cc80c22bf67ad5548afb30b
This reverts commit 2961e82bfa
This broke cinder unit tests that have a timeout test for novaclient
where they mock the requests library raising a Timeout exception. That
test expects to get a requests Timeout passed through but with the
change being reverted it was getting a RequestTimeout exception from
novaclient, which breaks the test and fails the gate runs.
We could change the cinder unit test to handle both the requests.Timeout
and the new novaclient RequestTimeout, but that's just papering over
the cinder failure, we wouldn't know what other clients are failing
in the same way because they have code working around the requests
exceptions getting passed through, so we should treat this like an API
change.
I'd be in favor of making the same change again iff the novaclient
exceptions extended the requests exception types so it would be transparent
to consumers, since novaclient.exceptions.RequestTimeout would be a
requests.Timeout via inheritance. But given the gate breakage and it being
summit week I'm inclined to revert first and think about a better long term
fix later when people are back to discuss.
Change-Id: I368728588e5997eef860a168539eb66c58f2e72a
Closes-Bug: #1510790
Novaclient expects the requests library to always be able to get a
response back and doesn't handle other cases where it might raise
an exception even before the request is completed (e.g.
ConnectionError).
These exceptions should be captured and properly converted to some
native novaclient exception.
Change-Id: Iec7247b715c38c29910b30e76413cead4e951a37
Co-Authored-By: Kuo-tung Kao <jelly.k@inwinstack.com>
Closes-Bug: #1406586
This method is redundant and blocks versioned client classes to change
interface. `novaclient.client.Client` should be used instead.
Releated-Bug: #1493576
Change-Id: I73cea2c6062419d75646e9239c6194f4d1ffd2b1
A lot of project uses incorrect import of versioned novaclient client obj
(i.e. novaclient.v2.client.Client). It leads to unability to change
interface of such inner classes.
This patch updates docs to include warning note and add warning message to
`novaclient.v2.client.Client` object.
Change-Id: Ifeba391716d3d51d6a75a53cad405e1ec595e27b
Related-Bug: #1493576