Commit Graph

14 Commits

Author SHA1 Message Date
Stephen Finucane b5ddc0732e Remove dependency on oslo_config
Per the note in requirements.txt, we do not want to depend on any oslo
library. Fix the accidental inclusion of this library.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I0287fc2493831e9b52790f7d6db13b8a4ed7158e
2023-12-14 10:44:36 +00:00
Pierre-Samuel Le Stang f136680870
Allow setting retriable status codes for Adapter via configuration options
Signed-off-by: Pierre-Samuel Le Stang <pierre-samuel.le-stang@corp.ovh.com>
Change-Id: Id7ad3f398891361abe62027248eba0f5eb1934d7
2023-10-20 10:03:46 +02:00
Dmitry Tantsur bca9ee7d3c Allow requesting fixed retry delay instead of exponential
Clients like ironicclient and swiftclient use fixed delay for their
build-in retry functionality. To replace it without changing behavior
we need a similar feature.

Change-Id: I1f9de98dae5719842f03d45e5a9d724199d5718b
2019-07-29 13:07:38 +02:00
Dmitry Tantsur 92921c6016 Allow setting retry counts for Adapter via configuration options
Change-Id: I67ba69bfff69676ceb28b8a7515f10f5eff21c4c
2019-06-19 15:24:11 +02:00
Eric Fried f83f3fb750 Factor Adapter conf-processing logic into a helper
Subclasses of keystoneauth1.adapter.Adapter, such as openstacksdk's
openstack.proxy.Proxy [1], would like to be able to obtain configuration
from oslo_config conf options.

This commit splits the conf processing logic out of
keystoneauth1.loading.adapter.Adapter.load_from_conf_options (aka
keystoneauth1.loading.load_adapter_from_conf_options) into a helper
method, keystoneauth1.loading.adapter.process_conf_options.

This is a straight refactor, so no test changes are necessary.

[1] 16f2dbe3b0/openstack/proxy.py (L113)

Change-Id: I250c431ccf3883901f7dce151bc5011ac305f829
2019-03-18 10:45:51 -05:00
Eric Fried e495c33d79 Recommend unversioned for endpoint-override
Update the help string for Adapter's endpoint-override conf option to
recommend specifying the unversioned endpoint.  This is so that ksa can
do the appropriate endpoint discovery itself.

Change-Id: I6178a7c0b80e22cc48f049efc24d1c74f26d4b2d
2017-09-05 10:34:31 -05:00
Monty Taylor 81ec69116a Protect against missing interface attribute
If deprecated options aren't registered, interface will not exist,
resulting in NoSuchOptError.

Add safeguards around accessing the interface opt, and appropriate test
cases.

Co-Authored-By: Eric Fried <efried@us.ibm.com>
Closes-Bug: #1707273
Change-Id: Ic3df9817f0038f8f610db70d7e34fe9d458606b6
2017-08-17 20:50:38 +00:00
Eric Fried aeb38d5d08 Adapter.get_conf_options(deprecated_opts)
Support a deprecated_opts dict kwarg to
keystoneauth1.loading.adapter.Adapter.get_conf_options that behaves just
like the one for keystoneauth1.loading.session.Session.get_conf_options

Ditto register_conf_options.

Change-Id: I40b568c1b8570b349def0a966526ed4515d08105
Closes-Bug: #1708673
2017-08-15 16:33:49 -05:00
Pavlo Shchelokovskyy 2195845fd1 Fix exception message in adapter loading
string formatting variable was missing

Change-Id: I74b614048a1a1fe00ca14fb0313a760909a068ce
2017-08-04 11:38:02 +03:00
Eric Fried 81363eca79 get_conf_options can exclude deprecated opts
Add the ability to exclude deprecated conf options from
Adapter.get_conf_options via a new kwarg, include_deprecated, which (for
backward compatibility) defaults to True.

Closes-Bug: #1706775
Change-Id: I9245d2b983482154959ba05d7d8496a947f1c701
2017-07-26 16:16:01 -05: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
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
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
Eric Fried 1fd43be5ce Introduce keystoneauth1.loading.adapter
In the spirit of keystoneauth1.loading.session,
keystoneauth1.loading.adapter.Adapter is a BaseLoader subclass providing
oslo_config* options suitable for inclusion by config groups wishing to
support keystoneauth1.adapter.Adapter operations such as endpoint
discovery.

*Future work should be done to move the argparse options from
keystoneauth1.adapter.Adapter into the new loading.adapter.Adapter class
for consistency.

Change-Id: Icb8c295799cc5ef4ca16f44c238838668fb7ab93
Partial-Implements: bp use-service-catalog-for-endpoints
2017-05-01 17:20:54 -05:00