Commit Graph

1398 Commits

Author SHA1 Message Date
Tony Breeds 1068cb6f7f Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).

Change-Id: I3ca69746ffe73b7c01c3066476589fac8e16a5e9
2017-09-12 16:00:55 -06:00
Monty Taylor ccbd20ed9c
Ensure constructed urls have trailing '/'s
The previous behavior in keystoneauth for constructing an unversioned
endpoint if there's a versioned endpoint in the catalog would result in
a trailing slash. Ensure that we end up with trailing slashses on
endpoints we construct.

On the other hand, do not add trailing slashes to urls we're actually
using. If someone wants a / the url they register with the catalog, they
can put one there.

Change-Id: I2798216b5b93d49fd5d3d865193cc0be6a1f6f0d
Closes-Bug: #1705770
2017-07-22 12:17:27 +09:00
Eric Fried f6c9d042e3 Handle pathless URLs
Among the zillion permutations being tested, there was no test case for
discovery URLs lacking a path component (e.g. 'http://foo:123' as
opposed to 'http://foo:123/v2').  A new discovery code path was indexing
the second-to-last part of the path component, resulting in IndexError
when the discovery data contained a pathless URL.

This change set fixes the IndexError and adds unit test coverage for
pathless URLs in discovery data.

Change-Id: I990a24ea32d0f7123566053046c80e48bce0536b
Partial-Bug: #1705770
2017-07-21 20:50:21 -05:00
Jenkins 5715035f42 Merge "Add note to requirements.txt" 2017-07-20 23:08:29 +00:00
Jenkins 353b926042 Merge "Fixed minor review comments and updated docs" 2017-07-20 21:55:44 +00:00
Morgan Fainberg c09072ea5d Add note to requirements.txt
Add note regarding dependencies (oslo)
to ensure oslo requirements and other
similar requirements are not added to
keystoneauth.

Change-Id: Ifedf1ed8ac3130b699d14208524612aed999949d
2017-07-20 20:32:37 +00:00
Monty Taylor 5058d40c51 Fixed minor review comments and updated docs
The previous microversion patch had some review comments from samuel and
colleen that this addresses. Also, add a release note.

Change-Id: Id83643ee5a00abc5134a88dfa5bc8ddb4f5a247a
2017-07-20 18:36:12 +00:00
Eric Fried e2d4c30dcb Make discover.version_between private
There's some ongoing concern about exactly how discover.version_between
should work.  Since it's new, make it private initially in the release
to give us time to work it out.

Change-Id: I349423f1b3da74b139f5fec838597c9a824ba571
2017-07-20 09:59:06 -05:00
Jenkins 029b2a37e9 Merge "Discourage 'version' and accept 'M.latest'" 2017-07-20 00:37:54 +00:00
Eric Fried 699fac136f Discourage 'version' and accept 'M.latest'
We're discouraging the use of the ambiguous and difficult-to-understand
'version' parameter in new discovery methods, instead encouraging the
use of min_version and max_version.

In order to make it possible to get the same functionality, though, we
need a way to say the same thing as version="M.m", which actually means,
"min version is M.m, and max version is the latest within major version
M".

Introducing 'latest' syntax, which can be used in various ways,
including:

min_version='2.3', max_version='2.latest'

...which is equivalent to the old school version='2.3'

Change-Id: Ife842333e25c33e54bbae4c1adb101014cb8e8db
2017-07-19 12:38:14 -05:00
Jenkins fc950862c3 Merge "Add ability to specify a microversion in a request" 2017-07-19 16:39:13 +00:00
Jenkins 7fb369881c Merge "Update URLs in documents according to document migration" 2017-07-19 08:50:52 +00:00
Jenkins f83094ba06 Merge "Enable sphinx todo extension" 2017-07-19 08:50:42 +00:00
Monty Taylor 218adc333e
Add ability to specify a microversion in a request
The user now has the ability to know what microversions are available,
but needs to be able to send a microversion header with their request.

Add a microversion parameter to Session that will construct and send the
header. The microversion header requires a service_type. One should be
available but it's possible for it to be missing if someone is using an
endpoint_override. Provide a parameter to let the user specify a
service_type for the microversion call in such cases.

Change-Id: I63cdd67701749630228f9496eda82b3c8747a608
2017-07-19 02:51:49 +09:00
Jenkins b0b5d1d88f Merge "Add support for next_min_version and not_before" 2017-07-18 16:48:45 +00:00
Jenkins c31240b5b3 Merge "Minor cleanup" 2017-07-18 16:16:40 +00:00
Jenkins f1f4c4413d Merge "Remove kwargs from adapter.get_endpoint_data" 2017-07-18 11:04:37 +00:00
Jenkins d40959cbd6 Merge "Remove deprecated_since for interface and fix text" 2017-07-18 11:04:31 +00:00
Jenkins 3071cf64cf Merge "Expose valid_interfaces as a ListOpt for config files" 2017-07-18 11:04:21 +00:00
Monty Taylor 4dc2a40f0b
Remove deprecated_since for interface and fix text
Version number for keystoneauth is still being debated. Remove this
as it's not strictly necessary anyway. The deprecation explanation is
also very clunky. Fix it.

Change-Id: I2cd39c5c01995b3e6cf22616c5343d8e1c4ce43b
2017-07-17 18:27:55 -05:00
Gage Hugo 0948e5e6da Enable sphinx todo extension
In a previous change [0] when warning-is-error was added, the
sphinx todo extension was causing errors with duplicate
registration. However with the recent changes between pbr and
sphinx, this extension no longer throws a duplicate error when
using warning-is-error and we can add it back in.

[0] https://review.openstack.org/#/c/439797/

Change-Id: I2c3c44015f5b961c56360f44b52c56629760de43
2017-07-17 11:16:19 -05:00
Jenkins accecea89b Merge "Add min_version and max_version to adapter constructors" 2017-07-15 15:40:34 +00:00
Monty Taylor 24b09f4088 Add support for next_min_version and not_before
The API-WG just approved the spec for version discovery documents to
optionally provide "next_min_version" and "not_before" information.

  http://specs.openstack.org/openstack/api-wg/guidelines/microversion_specification.html#version-discovery

The intended use of these is to communicate that at a point in the
future the service plans to raise the minimum microversion. It can't say
when that will happen, as a service does not know when deployers will
decide to upgrade their services. But it can communicate the earliest
date it's possible to happen, which would be the first date the service
itself would raise the minimum.

This can be used to emit warnings to users who are using a microversion
less than the next_min_version and to tell them how long they have to
think about it.

Currently keystoneauth will not consume these for that purpose. This
patch is merely about collecting the information from the discovery
document if it is there so a consumer can take action on it if they
wish.

Change-Id: Ibc404ef55eeae721a0d1d16e4e3e51ad77b5a75c
2017-07-15 14:29:24 +00:00
Monty Taylor de41fec992 Remove kwargs from adapter.get_endpoint_data
get_endpoint_data on an adapater is intended to return the endpoint_data
for the endpoint the adapter is mounted to, so passing in additional
kwargs doesn't make any sense. What's more, the interaction between the
existing values and the passed in values is hard to reason about.

Update the docs on using get_endpoint_data to highlight this.

Change-Id: I851c615407bc3e22af4350a4facf8488fa9c7945
2017-07-15 14:27:28 +00:00
Monty Taylor 98b7292aad
Expose valid_interfaces as a ListOpt for config files
interface can take a list of values now, so needs to be exposed as such
for config file consumption.

Since this is a new option we can be stricter. Add checking to make sure
only public, internal and admin can be passed as values.

Change-Id: I17043cd93072bbfd1389d44935bcf9a653e1d6a0
2017-07-15 09:17:53 -05:00
Jenkins 0847a6d990 Merge "Add 'none' identity plugin" 2017-07-14 22:41:18 +00:00
Monty Taylor 8161ed81d6 Add min_version and max_version to adapter constructors
They should be here as an Adapter is essentially a codified
endpoint_filter.

Add them to the conf options for Adapter, since that is how Adapters get
defined in services which is one of the reasons for doing all of this
work.

Change-Id: I8c6613bac09f28169e903b303c7330b1e90fe72d
2017-07-14 17:18:24 -05:00
Jenkins 33e9681a79 Merge "Add paragraph clarifying major and micro versions" 2017-07-14 22:11:38 +00:00
Eric Fried 0007f373ce Minor cleanup
Couple of docstring typos.

Change-Id: Ie3b7fcefde33adc3e4576ecb1a2a96ba47f8400e
2017-07-14 21:41:18 +00:00
Jenkins 0244d9dbf8 Merge "Update docs and add a release note" 2017-07-14 21:03:21 +00:00
Jenkins fadb8b6dd9 Merge "Using assertFalse(A) instead of assertEqual(False, A)" 2017-07-14 19:55:18 +00:00
Monty Taylor 05c3a471ae
Add paragraph clarifying major and micro versions
People get confused with major version discovery vs. microversion usage.
Try to make it very clear what's going on.

Change-Id: I2be8670998f531ee4777876413979a63279a59ab
2017-07-14 14:32:41 -05:00
Monty Taylor 416675f619
Update docs and add a release note
We added a bunch of new capabilities around discovery. Document them.

Change-Id: Ie0fa47e0cee918d7b8a9069eaf01931f64a54e58
2017-07-14 09:47:36 -05:00
melissaml 885acfec57 Update URLs in documents according to document migration
Change-Id: I5afc149ab61e037cb3d9dd355975802a37342cf8
2017-07-14 09:23:53 +08:00
Jenkins 4bd21251cc Merge "Miscellaneous cleanup in discover.py" 2017-07-13 22:30:58 +00:00
Jenkins 7583f46a7b Merge "normalize_version_number([1]) => (1, 0) and docs" 2017-07-11 22:20:04 +00:00
Jenkins 30e85a6db1 Merge "Expand some discover.py docstrings" 2017-07-11 22:03:12 +00:00
Jenkins 93f32c3ff8 Merge "Make Discover.version_data accept null max_version" 2017-07-11 21:52:23 +00:00
Jenkins 17a1d8c06a Merge "Fix _run_discovery caching" 2017-07-11 19:27:53 +00:00
Eric Fried 4e4a1a89dd Make Discover.version_data accept null max_version
Make Discover.version_data a little more lenient in the JSON data it
accepts with respect to "max_version" and "version".  Previously, if the
"max_version" field was present but empty, the "version" field would be
ignored, even if populated with a proper version number.  This goes
against the intent of the API.  This change causes version_data to
ignore a blank "max_version" if "version" is populated.

This change also introduces a unit test harness for the various
permutations of version_data translating input version data to
min/max_microversion, including cases for the above.

Change-Id: I1cb4ebdd57a6eadc1a16efc0fc1ceeda640f26c2
Closes-Bug: #1703438
2017-07-11 14:14:33 -05:00
Eric Fried 7293a7b39f Miscellaneous cleanup in discover.py
Remove some unused variables.

Remove a couple of unused parameters from private method
EndpointData._run_discovery.

Fix some formatting issues to reclaim a line or two, or because my IDE
flags them.

Change-Id: Idcc1f1e4dc6068125ea30ce0ab482a99a9e0b1cc
2017-07-11 16:47:32 +00:00
Eric Fried 1415a94586 normalize_version_number([1]) => (1, 0) and docs
Fix an edge case where discover.normalize_version_number could return a
one-member tuple rather than the expected >=2-member tuple.

Fix up the docstring for the same, including the above behavior.

Change-Id: Ibe54da05705846e47063f8fc639b31df773bed9d
Closes-Bug: #1703414
2017-07-10 15:38:15 -05:00
Eric Fried d6449772ba Fix _run_discovery caching
EndpointData._run_discovery thought it was caching already-tried URLs,
but it was really caching each letter of each URL, so the cache wasn't
working:

 tried = set()
 ...
 if vers_url in tried:
     continue
 tried.update(vers_url)  # Adds each char of `vers_url` to `tried`

Changed that last line to:

 tried.add(vers_url)

Added a unit test for same.

Change-Id: I894636d846de4a3b63000f9e2f79f378134c1de8
Closes-Bug: #1703447
2017-07-10 14:55:35 -05:00
Eric Fried 498320a5fb Nix EndpointData.get_versioned_data(authenticated)
Remove unused `authenticated` kwarg from as-yet-unreleased public API
EndpointData.get_versioned_data, and private method
EndpointData._set_version_info.

Change-Id: I03a9969df4586c79b6b63d44fcb5474dd94e6ba2
Closes-Bug: #1703446
2017-07-10 14:44:47 -05:00
Eric Fried 3ae350b5bf Expand some discover.py docstrings
Flesh out docstrings for the following in discover.py:
- get_version_data
- version_to_string
- Discover.version_data
- EndpointData._get_version_discover_hack

and keystoneauth1.fixture.discovery.MicroversionDiscovery

Change-Id: I0358a86b13c8a9d2179d5bbf66a7ded7e6c777d1
2017-07-10 19:21:27 +00:00
Jenkins 37a2352a21 Merge "Switch from oslosphinx to openstackdocstheme" 2017-07-07 16:59:03 +00:00
Jenkins ae89ac18ca Merge "Optimize the link address" 2017-07-06 05:54:50 +00:00
Boris Bobrov 5e3758a8fc Change locations of docs for intersphinx
Due to latest change in docs the old urls don't work and cause
gate failures. Fix it to reflect the new locations.

Depends-On: I7e170275fd422345505b7282b52899d08c7a4172
Change-Id: I2a4fc6a4782a5496b2ab4a8355ed2c3b6dac58fa
2017-07-05 12:02:12 +03:00
Jenkins b007f9c053 Merge "Clean up a few review nits" 2017-07-02 20:25:34 +00:00
Monty Taylor 26f9345e18 Clean up a few review nits
Remove four unneeded things in unit tests, updated a docstring,
and changed TypeError to ValueError.

Change-Id: Iad43ab2afa3767739ef3137b2691875520d052b3
2017-07-02 17:43:42 +00:00