summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2018-05-16 10:13:44 -0500
committerMonty Taylor <mordred@inaugust.com>2018-05-16 15:42:03 -0500
commit80323289c71a39603166a9cfe4a56cb4d5784356 (patch)
tree2410624ecf7acbe0f006f8ce58c87d3e5c361d7b
parent244780fba84f008ddb2892b4c24ca2eb3fbcb0db (diff)
Add oslo.config option for split-loggers
For people setting creating Sessions via load_from_conf_options, such as the OpenStack services, turning on split-loggers needs to be done in a config file. In order to do that, we need to expose it in the conf options list. Don't add it to the argparse options for now - it would just add another command line option that is less likely to see use. Change-Id: I106c6acbe306e581d293612630ec810c11d9d61c
Notes
Notes (review): Code-Review+2: Colleen Murphy <colleen@gazlene.net> Code-Review+2: Lance Bragstad <lbragstad@gmail.com> Code-Review+1: Cuong Nguyen <cuongnv@vn.fujitsu.com> Code-Review+1: Neha Alhat <neha.alhat@nttdata.com> Code-Review+2: Morgan Fainberg <morgan.fainberg@gmail.com> Workflow+1: Morgan Fainberg <morgan.fainberg@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 17 May 2018 21:06:52 +0000 Reviewed-on: https://review.openstack.org/568878 Project: openstack/keystoneauth Branch: refs/heads/master
-rw-r--r--keystoneauth1/loading/session.py8
-rw-r--r--keystoneauth1/tests/unit/loading/test_session.py1
-rw-r--r--releasenotes/notes/oslo-config-split-loggers-6bda266d657fe921.yaml4
3 files changed, 13 insertions, 0 deletions
diff --git a/keystoneauth1/loading/session.py b/keystoneauth1/loading/session.py
index 1e58064..ba7e299 100644
--- a/keystoneauth1/loading/session.py
+++ b/keystoneauth1/loading/session.py
@@ -147,6 +147,7 @@ class Session(base.BaseLoader):
147 :insecure: Whether to ignore SSL verification. 147 :insecure: Whether to ignore SSL verification.
148 :timeout: The max time to wait for HTTP connections. 148 :timeout: The max time to wait for HTTP connections.
149 :collect-timing: Whether to collect API timing information. 149 :collect-timing: Whether to collect API timing information.
150 :split-loggers: Whether to log requests to multiple loggers.
150 151
151 :param dict deprecated_opts: Deprecated options that should be included 152 :param dict deprecated_opts: Deprecated options that should be included
152 in the definition of new options. This should be a dict from the 153 in the definition of new options. This should be a dict from the
@@ -188,6 +189,11 @@ class Session(base.BaseLoader):
188 'collect-timing'), 189 'collect-timing'),
189 default=False, 190 default=False,
190 help='Collect per-API call timing information.'), 191 help='Collect per-API call timing information.'),
192 cfg.BoolOpt('split-loggers',
193 deprecated_opts=deprecated_opts.get(
194 'split-loggers'),
195 default=False,
196 help='Log requests to multiple loggers.')
191 ] 197 ]
192 198
193 def register_conf_options(self, conf, group, deprecated_opts=None): 199 def register_conf_options(self, conf, group, deprecated_opts=None):
@@ -200,6 +206,7 @@ class Session(base.BaseLoader):
200 :insecure: Whether to ignore SSL verification. 206 :insecure: Whether to ignore SSL verification.
201 :timeout: The max time to wait for HTTP connections. 207 :timeout: The max time to wait for HTTP connections.
202 :collect-timing: Whether to collect API timing information. 208 :collect-timing: Whether to collect API timing information.
209 :split-loggers: Whether to log requests to multiple loggers.
203 210
204 :param oslo_config.Cfg conf: config object to register with. 211 :param oslo_config.Cfg conf: config object to register with.
205 :param string group: The ini group to register options in. 212 :param string group: The ini group to register options in.
@@ -242,6 +249,7 @@ class Session(base.BaseLoader):
242 kwargs.setdefault('key', c.keyfile) 249 kwargs.setdefault('key', c.keyfile)
243 kwargs.setdefault('timeout', c.timeout) 250 kwargs.setdefault('timeout', c.timeout)
244 kwargs.setdefault('collect_timing', c.collect_timing) 251 kwargs.setdefault('collect_timing', c.collect_timing)
252 kwargs.setdefault('split_loggers', c.split_loggers)
245 253
246 return self.load_from_options(**kwargs) 254 return self.load_from_options(**kwargs)
247 255
diff --git a/keystoneauth1/tests/unit/loading/test_session.py b/keystoneauth1/tests/unit/loading/test_session.py
index bc42a59..c3f773e 100644
--- a/keystoneauth1/tests/unit/loading/test_session.py
+++ b/keystoneauth1/tests/unit/loading/test_session.py
@@ -77,6 +77,7 @@ class ConfLoadingTests(utils.TestCase):
77 'insecure', 77 'insecure',
78 'timeout', 78 'timeout',
79 'collect-timing', 79 'collect-timing',
80 'split-loggers',
80 ] 81 ]
81 depr = dict([(n, [new_deprecated()]) for n in opt_names]) 82 depr = dict([(n, [new_deprecated()]) for n in opt_names])
82 opts = loading.get_session_conf_options(deprecated_opts=depr) 83 opts = loading.get_session_conf_options(deprecated_opts=depr)
diff --git a/releasenotes/notes/oslo-config-split-loggers-6bda266d657fe921.yaml b/releasenotes/notes/oslo-config-split-loggers-6bda266d657fe921.yaml
new file mode 100644
index 0000000..1937bce
--- /dev/null
+++ b/releasenotes/notes/oslo-config-split-loggers-6bda266d657fe921.yaml
@@ -0,0 +1,4 @@
1---
2features:
3 - |
4 Added ``split-loggers`` option to the oslo.config Session options.