magnum/magnum/api
Dane LeBlanc 617b772e55 Modify magnum api context to use user_name and project_name
Problem description:
If DevStack is used to instantiate the magnum plugin, and the
devstack localrc/local.conf has the default values for:
   LOG_COLOR (default value = True)
   SYSLOG (default value = False)
then upon startup (i.e. running DevStack's stack.sh), the magnum devstack
lib calls the DevStack common setup_colorized_logging function, but
without passing the optional 'project_var' and 'user_var' arguments to
this function. As a result, the setup_colorized_logging
function uses its default values of "user_name" and "project_name"
when it defines the logging_context_format_string (which in turn gets
configured in /etc/magnum/magnum.conf). The problem is that "user_name"
and "project_name" are not defined in the API context used by Magnum,
so that whenever the magnum plugin does a logging call, a KeyError
exception for the non-existant key "user_name" is generated.

Fix description:
The fix is to modify the Magnum context to use "user_name" and
"project_name" attributes to be consistent with the default context
format string set up by DevStack.

Change-Id: Ia0c34899609735ff9d8b4597101e004e2684657e
Closes-Bug: #1464376
2015-06-15 18:27:15 -04:00
..
controllers Merge "Add support for API microversions" 2015-06-09 05:21:19 +00:00
middleware Merge "Fix continuation line under/over indented problems" 2015-05-31 21:10:25 +00:00
__init__.py Initial commit from github (squashed) 2014-11-18 09:23:37 -05:00
app.py Remove imports from oslo namespaces 2015-02-08 02:59:30 +00:00
auth.py Remove imports from oslo namespaces 2015-02-08 02:59:30 +00:00
config.py Port NoExceptionTracebackHook from Ironic 2015-01-17 19:58:19 +00:00
hooks.py Modify magnum api context to use user_name and project_name 2015-06-15 18:27:15 -04:00