With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.iteritems' and 'six.iterkeys' can
be replaced by 'items' and 'keys', 'six.moves.urllib.parse'
can be replaced by 'urllib.parse', 'six.StringIO' and
'six.moves.cStringIO' can be replaced by 'io.StringIO',
'six.text_type' and 'six.string_type' are just 'str'.
Change-Id: I357968c6a1932856b1600f6c191966bc90cbc258
_clean() method is renamed to clean() in osprofiler 2.3.0.
It was suggested in a past neutronclient review.
Closes-Bug: #1783789
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Depends-On: https://review.openstack.org/#/c/592018/
Change-Id: Ic8e03db85dc08cfdcac5507e99ecdf7eac8eb972
Right now, it is impossible to set HTTP headers in client because
the 'headers' parameter is not set. This patch fixes it.
Change-Id: Iff002aaca516e8d014074f120b7f713758ebf265
Partial-Bug: #1737473
Openstack common has a wrapper for generating uuids.
We should use that function to generate uuids for consistency.
Change-Id: I86ae28e6042d1fac2b08540add8a9e23c9254c86
This provides the facility to take global_request_id as a construction
parameter for a neutron client, and pass it through the system. This
will be used by Nova and others to set global_request_id so requests
can be tracked across services.
oslo spec I65de8261746b25d45e105394f4eeb95b9cb3bd42
Change-Id: I7ed48ad247676c71a3a7b12585572c398dda06e0
To be able to create profiling traces for Neutron, 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 nova calls neutron via python client, if
profiler is initialized in nova, neutron client will add extra
header, that will be parsed by special osprofiler middleware in neutron
api.)
Closes-Bug: #1335640
Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Change-Id: Ic11796889075b2a0e589b70398fc4d4ed6f3ef7c
There are a lot of H405 violation codes.
We need to fix the code for avoiding more violations.
Change-Id: Iaa83626b81a3d8369b16e2b4f394e2bc4628998a
Closes-Bug: #1521899
As XML support has been removed from neutron, there is no need
to keep it in client.
Dropped XML serializer and deserializer and deprecated "request-format"
CLI option, making JSON the default and the only supported request
format.
DocImpact
Change-Id: I88b0fdd65a649694252d5ff43a174e75026df5b1
Closes-Bug: #1380787
keystoneauth1 is the new auth-only library for getting keystone
Sessions, which is lighter-weight and does not require the entire
keystoneclient library. It also handles all of the keystone
version discover and plugin selection so that code doesn't have to
live in neutronclient.
Additionally, use os-client-config to process options and get the
Session from keystoneauth1. This adds support for reading clouds.yaml
files and supporting the OS_CLOUD env var for selecting named clouds
from a list of them.
This is a step towards bug#1503428 but is not the whole picture.
Remove the auth tests - since they are covered inside of ksa.
Closes-Bug: #1507384
Change-Id: Ic4f9fd8f231c33513fd74da58ab1b4a3fb00d9f4
Kill off mox and use requests_mock. There are fixtures available for
everything we want to test - there is no reason to resort to using mox.
This cleans up and makes clearer a lot of tests.
Change-Id: I2633bcaf36388fb4db1de4cd75d5ccd76f961509
The httpretty library has poor Py3 support, currently the only
working version is 0.8.0, all later minor versions are pinned.
Requests-mock library provides mocking layer for requests package. It is
written in such a way that it is fairly simple to convert existing
httpretty test suites to requests-mock. The library is hosted at Stackforge
and gated as usual OpenStack project.
Change-Id: If7f4baefb53976571efc47dda17a7b543112d555
Currently SessionClient.request never specifies Content-Type/Accept
headers in requests where HTTPClient.request always specifies json
Content-Type/Accept even with "--request-format xml" option ... requests
succeed because neutron deduces Content-Type/Accept from url suffix when
defined.
This change ensures HTTPClient/SessionClient define Content-Type/Accept
headers when needed and align them with --request-format option.
Closes-Bug: #1368335
Change-Id: I909e055e5e59fa5870a28ebb0f171812acca0745
mox3 is a Python 3.x compatible drop-in and allows
to continue with the porting effort to Python 3.x with
minimal code changes.
Closes-Bug: #1283482
Change-Id: Ib052f1b87e312481e4c7c8d775ece94f53e7106b
This change introduces the use of requests in lieu of httplib2
to ensure proper handling of SSL termination.
Implements: blueprint tls-verify
Change-Id: If182f2addf26421873b8c3d2b60f8cba9b7a9450
This commit also removes a blank line displayed
when error_dict['detail'] is empty.
When 403 is returned, Forbidden exception is raised from
HTTPClient (neutronclient/client.py). There is no reason
this exception is raised by it. By this commit v2_0.client
now handles 403 response to show human friendly message
by parsing Neutron 2.0 -specific error format.
Change-Id: Iefbd7db094267fe3799ebf4713e142e62c63174c
Closes-Bug: #1246271
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.
Change-Id: Ic30e91df1b0e25beda9b8d8c19be58573cdae4f6
Closes-Bug: #1229324
Neutron itself has all of its tests in neutron/tests, as do 2/3 of
the projects in OpenStack. There are a wealth of reasons to put
them in the package, not the least of which that tests/__init__.py
implies a code living in a global namespace called tests.
Change-Id: I2aaacfe59d6790648aa4587e89e6dd28a9149a6c