Closed
Bug 675105
Opened 13 years ago
Closed 13 years ago
Config.get() should accept an optional default value
Categories
(Cloud Services :: Server: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jrconlin, Unassigned)
Details
(Whiteboard: [qa-])
Currently services-core.services.config.Config.get(section, item) does not accept an optional default value. This breaks the established Python behavior of dictionary like items having a default if not present.
Comment 1•13 years ago
|
||
AFAICT services.config.Config inherits from dict and has the same behaviour as dict.get, so I guess you're talking about services.config.SvcConfigParser.
In that case, maybe it's better to be consistent with ConfigParser.ConfigParser.get(), which takes a dict of defaults rather than a single value?
Comment 2•13 years ago
|
||
(In reply to Ryan Kelly [:rfkelly] from comment #1)
> AFAICT services.config.Config inherits from dict and has the same behaviour
> as dict.get, so I guess you're talking about services.config.SvcConfigParser.
This is a recent change... the Config object itself used to inherit from RawConfigParser and thus didn't support a default value.
> In that case, maybe it's better to be consistent with
> ConfigParser.ConfigParser.get(), which takes a dict of defaults rather than
> a single value?
The config parser should really be an implementation detail going forward, so my guess is that this bug is soon to be obsolete.
Comment 3•13 years ago
|
||
We cleaned up all the dictionary handling for cornice, so if there are still nastinesses in there, let's file a new bug for that.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•