Commit Graph

8 Commits

Author SHA1 Message Date
Q.hongtao d1bd783a77 Fix misspell word
Change-Id: I2b727f28733b1f7e2bb0e2dfa94a39bfdd7449fc
2019-09-09 09:02:14 +08:00
Abhishek Sharma 0c0eae3b1e Expect paste.deploy and gnocchi/panko options
The authtoken middleware has been printing warning log messages to
the API logs for all services, reporting unexpected conf keys. This
was traced back to paste.deploy adding 'here' and '__file__' and
both gnocchi and panko adding 'configkey' keys in wsgi apps though
these do not actually exist in the conf file. This change allows
for those keys without printing a warning that unnecessarily
confuses operators.

But it's kind of a hack, especially the configkey bit. We shouldn't
have to know about gnocchi/panko specifics like this. And it doesn't
address the comment in the bug about what is seen for ironic. So I
think there will still be more to do here.

Change-Id: I678482309c7dd35ce147bebf13ebefc84251fe91
Partial-Bug: 1722444
2017-12-07 10:43:49 -05:00
Van Hung Pham 8c017470ad Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators.
We can use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys will more readable.

2.In py2, the performance about list should be negligible, as link [2].

[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Id1cab2190424f1ac8b48cae43e4006f1d720be0c
2017-07-12 13:43:55 +07:00
xuhaigang ba78db0b4b add a log when the option in conf can't be identitied
When the option is unknown to auth_token and it's value can't be
converted, this patch adds a warning log.

Change-Id: I818708cc19488030b80daa2b01b9f8622632f7eb
2017-06-04 00:05:32 +00:00
Jamie Lennox adcdecb117 Pop oslo_config_config before doing paste convert
This doesn't make a huge difference but if we don't pop the local oslo
conf options from the conf dict then they remain around in the paste
overrides dict.

Rearrange them to pop rather than testing there presence.

Change-Id: I9482831d6d415da0a2e38fd3c39f58ba96740842
2016-06-24 15:12:47 +10:00
Thomas Herve 2798b2ebdf Fix an issue with oslo_config_project paste config
When oslo_config_project is specified in the paste config, we need to
lookup the configuration file properly. Commit
f8c150a9cc changed the way we looked up
for the default config files, and passed an empty list instead of None,
which means that no look were done anymore. This restores the previous
behavior.

Change-Id: I6aec548cec24dfcd48e4c116c07f53cc097c6059
Closes-Bug: #1594930
2016-06-21 22:02:42 +02:00
Jamie Lennox 5cabfc1db0 Consolidate user agent calculation
Move all the auth_token middleware user_agent calculation into config
and only expose the user_agent property.

Change-Id: Ia6833845262c4de87ef95079de24d264e06f54fc
2016-06-10 18:22:44 +00:00
Jamie Lennox f8c150a9cc Create a Config object
The _conf_get ugliness in auth_token middleware has been around for a
long time now to handle the abstraction from different oslo.config
options and the paste overrides. This logic is now also being needed in
other middlewares. Extract this into a common config object that has a
better interface and is easier to work with.

Change-Id: I8b8a1427bc527e43bb1baec25a881d93df3f93cc
2016-06-10 18:21:56 +00:00