oslo changes to logging_context_format_string not compatible with nova
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Critical
|
Davanum Srinivas (DIMS) | ||
oslo-incubator |
Fix Released
|
Critical
|
Davanum Srinivas (DIMS) | ||
Grizzly |
Fix Released
|
Critical
|
Davanum Srinivas (DIMS) |
Bug Description
oslo changeset efba20239c1253c
This changed default for logging_
test_init_host Traceback (most recent call last):
File "/usr/lib/
msg = self.format(record)
File "/usr/lib/
return fmt.format(record)
File "/home/
return logging.
File "/usr/lib/
s = self._fmt % record.__dict__
KeyError: 'user'
Logged from file vm_utils.py, line 1860
We need to either revert the oslo change, or come up with a way for nova to specify a new default, otherwise nova can't use the oslo logging code as is.
Changed in nova: | |
importance: | Undecided → Critical |
status: | New → Triaged |
Changed in oslo: | |
status: | New → Triaged |
importance: | Undecided → Critical |
Changed in nova: | |
assignee: | nobody → Davanum Srinivas (dims-v) |
Changed in oslo: | |
status: | Triaged → In Progress |
Changed in nova: | |
status: | Triaged → In Progress |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → grizzly-2 |
status: | Fix Committed → Fix Released |
Changed in oslo: | |
milestone: | none → grizzly-2 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | grizzly-2 → 2013.1 |
The review that introduced the probelm - https:/ /review. openstack. org/15956
A workaround nova can use is to do CONF.set_ default( 'logging_ context_ format_ string' ) but that method is really intended for testing not runtime
We don't have a great answer to this generally - how do we add a hooks to an API to allow the defaults of cfg-registered config options to be tweaked by the projects consuming the API
Hmm, maybe we could do something like this:
opts = [ 'foo'), 'bar', default=False),
StrOpt(
BoolOpt(
]
def set_defaults( bar=False) : set_defaults( opts, bar=bar)
cfg.
i.e. each module would explicitly say which defaults it encourages tweaking
and cfg would have:
def set_defaults(self, opts, **kwargs):
opt. default = default
break
for name, default in kwargs.items():
for opt in opts:
if opt.dest == name:
and nova/config would do:
def parse_args(argv): set_defaults( bar=True) CONF(argv[ 1:], project='nova')
logging.
cfg.