Commit Graph

11 Commits

Author SHA1 Message Date
Stephen Finucane c4c44bcb2d Remove six
Mostly a find-replace job. Let's do this now so we don't have to carry
it for the next decade.

Change-Id: I7bef9fb7c6895f746cee1aca6522786f38b9857c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:48:38 +00:00
Andrey Kurilin bd0a2adefe Fix cropping the endpoint url
`nova version-list` crops the endpoint url to exclude API version and
project-id(for microversions < 2.18). It is ok, but the code was
designed before Nova-API moved under uwsgi, which changed the endpoint
url format.

The latest endpoint url contains the hostname and port which can be one
for several services and it is a wrong case to cut the whole path from
the endpoint.

Closes-Bug: #1702194

Change-Id: Icba858b496855e2ffd71b35168e8057b28236119
2017-07-07 20:33:23 +00:00
Andrey Kurilin 2e5576dafc Remove all code related to HTTPClient
In previous patch we switched to use SessionClient in all cases. It means that all
HTTPClient code is redundant now.

Change-Id: I5a0da970fd82c79db3d88f1b49279133bbdba639
2016-12-16 12:56:18 +00:00
Takashi NATSUME 0414bab3d3 Add return-request-id-to-caller function(3/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/keypairs.py
* novaclient/v2/limits.py
* novaclient/v2/networks.py
* novaclient/v2/quota_classes.py
* novaclient/v2/quotas.py
* novaclient/v2/security_group_default_rules.py
* novaclient/v2/security_group_rules.py
* novaclient/v2/security_groups.py
* novaclient/v2/server_groups.py
* novaclient/v2/services.py
* novaclient/v2/usage.py
* novaclient/v2/versions.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I9203f70a0eef5686b590fbff35563f2cf8b6f586
Implements: blueprint return-request-id-to-caller
2016-01-28 11:22:00 +00:00
Sean Dague 4f16fe65c4 make project_id optional in urls for version discovery
Currently there is a baked in assumption throughout the nova ecosystem
that endpoint urls will end in {project_id}.

This means that the version document for a specific major API version
is "endpoint - last_chunk_of_url". This is not a discoverable URL,
it's one that we heuristically generate.

GET /v2.1/{project_id} is a 404.

If we make Nova able to handle endpoint ids without {project_id} we
run into a problem with novaclient, which is that end_point is now
/v2.1. The heuristic gives us a version url of /. Which returns a very
different doc than /v2.1. This causes all novaclient commands to explode.

In order to support this transition we need to make both Nova and
Novaclient handle endpoints with and without {project_id}.

The proposal is thus to try the raw value of the endpoint first. If it
works, great. If it fails with a 404, fall back to the heuristics.

While this change and the nova change are technically independent, we
should land this one as soon as possible, because clients before this
change will not work with Nova deploys that get rid of project_id in
their service catalog in the future.

Part of bp:service-catalog-tng

Co-Authored-By: Augustina Ragwitz <aragwitz+lp@pobox.com>
Change-Id: Id4a2f73cbcfcf36aea750375fd92b1c2d3cd824e
2015-10-22 11:10:56 -07:00
Daniel Wallace b2221c8a70 Fix bugs with rackspace
not all apis have the versions available

Rackspace api does not open up for querying versions.  This causes it to
still break when using the rackspace-auth-plugin

add tests for api_version Unauthorized

make sure that the list can still run even if the api_version check is
unauthorized.

Closes-Bug: #1493974
Closes-Bug: #1491579
Change-Id: I038b84bad5b747a0688aef989f1337aee835b945
2015-09-09 14:47:20 -05:00
Sean Dague e4b0d46c4b workaround for RAX repose configuration
The RAX Repose environment is blocking access to the API version
information by local policy, returning a 401 before we even get to
Nova itself. While this in clearly incorrect behavior, it is behavior
in the field, and we should not break all our users on that cloud.

This catches the 401 and translates that so that it's the equivalent
of only supporting v2.0. We will be taking these API calls to defcore,
and intend to remove this work around once that is done.

Change-Id: I2072095c24b41efcfd58d6f25205bcc94f1174da
Related-Bug: #1491579
2015-09-03 14:13:33 -04:00
Sean Dague c915757ed5 Don't assume oscomputeversions is correctly deployed
The paste pipeline that's "above" the /v2/ and /v2.1/ urls is the
oscomputeversions dispatcher, which should provide 300 redirects to
versions in question. Previously the code that was trying to discover
information about the current version did so via a GET of something
that looked like /v2. On an upstream compatible OpenStack this
actually triggers a 300 and redirect to /v2/ for the real answer.

On deployed public clouds, oscomputeversions is sometimes not deployed
at all, or front end blocking by the load balancer does
weirdness. Sometimes with a 401, sometimes a hang.

This fixes the way that first request is made that should avoid the
300 redirect entirely. The code probably should have done this
originally, but it was tested with upstream configuration that worked
fine in this case.

This fix is tested against HP Cloud (the only pub cloud I have creds
with). Before this fix "nova list" hangs trying to get the supported
versions, after the fix it works as expected.

Change-Id: I1692380fe8d340e5c044f46dd0b103c7550d2c7d
Closes-Bug: #1491579
2015-09-03 13:19:28 -04:00
Andrey Kurilin eddb4d61c2 Add "get_current" method to VersionManager
get_current returns the current endpoint's API version info.

Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I36e84680c578a88d5c274f8ca24ecd18d1f3a179
2015-07-27 19:55:37 +08:00
Ken'ichi Ohmichi 95421a3702 Don't use SessionClient for version-list API
The endpoint of version API doesn't contain "/v2/{project-id}" and it is
just "/". SessionClient is based on the endpoint "/v2/{project-id}/...",
so this patch makes a client use a raw url for version-list API.

Change-Id: I53f2afacce2dda14ac9761e824b48887f7c192f9
Closes-Bug: #1444235
2015-05-03 21:27:24 +00:00
Andrey Kurilin 0a60aae852 Rename v1_1 to v2
Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3.
Since future development(microversioning) will be done across V2,
implementation should be done in appropriate module(to prevent misleading).

Despite the fact that implementation for all versions are equal, discover
method for contrib path worked only for v1.1. This patch fixes this bug and
modifies shell tests to check all versions.

Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
2015-02-04 17:40:46 +02:00