Commit Graph

11 Commits

Author SHA1 Message Date
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 70e1f44169 Add tests for mutually exclusive [min|max]version
As suggested by Lance [1], add test cases to prove that configuring
`version` is mutually exclusive with configuring *either* `min_version`
or `max_version`.

[1] https://review.openstack.org/#/c/482742/7/keystoneauth1/tests/unit/loading/test_adapter.py@76

Change-Id: I4fea4d149feccebcbb29c34dc2bd4de5669aa1f4
2017-09-01 16:31:35 -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
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 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
Luong Anh Tuan 26fae838bb Replace assertTrue(isinstance()) with assertIsInstance()
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A,
B) provided by testtools.

Change-Id: Ib32ae0551f5fdc5bfffed8c0fce6cf18f8fae6c8
Closes-Bug: #1268480
2017-06-05 16:32:11 +07: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