Merge lp:~jaypipes/glance/bug756886 into lp:~glance-coresec/glance/cactus-trunk
Proposed by
Jay Pipes
Status: | Merged |
---|---|
Approved by: | Jay Pipes |
Approved revision: | 109 |
Merged at revision: | 110 |
Proposed branch: | lp:~jaypipes/glance/bug756886 |
Merge into: | lp:~glance-coresec/glance/cactus-trunk |
Diff against target: |
94 lines (+57/-4) 3 files modified
doc/source/glanceapi.rst (+1/-2) glance/utils.py (+15/-2) tests/unit/test_utils.py (+41/-0) |
To merge this branch: | bzr merge lp:~jaypipes/glance/bug756886 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thierry Carrez (community) | Approve | ||
Rick Harris (community) | Approve | ||
justinsb (community) | Approve | ||
Review via email: mp+57321@code.launchpad.net |
Description of the change
Change parsing of headers to accept 'True', 'on', 1 for boolean truth values.
To post a comment you must log in.
I'm not so sure I agree with the intent of this patch. The code doesn't match the docs; but, in this case, I think it might be the docs that are in the wrong.
I'm not sure why we would want to loosen our constraints around what's accepted by Glance's boolean fields. I know other projects do this, and it's arisen as a sort of anti-pattern to accept "1", "true" or "on" in a lot of config files. To me, though, a single "True" or "False" value is much less ambiguous and thus easier to communicate to users. ("Use true or false or it ain't gonna work!")
This might cause some issues when configs are more naturally expressed as "on" and "off". But the trade off of a single "Right Way" I think is worth the minor mismatch. Thoughts?
In terms of the code, looks good, but `isinstance` is preferred to `type()` these days (I believe).