CONF.set_override doesn't alias deprecated opts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.config |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
If I deprecate opt 'bad' in favor of opt 'good', I can still use a conf file that sets 'bad', and CONF.good will show up in my code with that value.
However, when I CONF.set_
Example:
=======
from oslo_config import cfg
from oslo_log import log
log.logging.
goodopt = cfg.StrOpt('good')
badopt = cfg.StrOpt('bad')
goodopt.
cfg.CONF.
cfg.CONF()
print('good: %s' % cfg.CONF.good)
print('bad: %s' % cfg.CONF.bad)
cfg.CONF.
print('good: %s' % cfg.CONF.good)
print('bad: %s' % cfg.CONF.bad)
=======
With conf file:
=======
[DEFAULT]
bad = foo
=======
Actual output:
=======
WARNING:
good: foo
bad: foo
good: foo
bad: bar
=======
Expected output:
=======
WARNING:
good: foo
bad: foo
good: bar
bad: bar
=======
Usually set_override is used in tests. I suggest use CONF.good in code, just leave CONF.bad for operators.