diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-03-30 08:35:32 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-03-30 08:35:32 +0000 |
| commit | c0541b1ea0a96cb7373112dbfd66484a5c7b674d (patch) | |
| tree | b299ba3206d4a6469eb43193e2acc6049f9ad0fc /openstack/common | |
| parent | f6cd8b79deb1f0ae3a132b67727afa0ab786e9ba (diff) | |
| parent | 34343acba97f41535b2e75866f99d58e44da088d (diff) | |
| download | oslo-c0541b1ea0a96cb7373112dbfd66484a5c7b674d.tar.gz oslo-c0541b1ea0a96cb7373112dbfd66484a5c7b674d.tar.xz oslo-c0541b1ea0a96cb7373112dbfd66484a5c7b674d.zip | |
Merge "Make 'yes' also a true boolean"
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openstack/common/utils.py b/openstack/common/utils.py index 8cc400a..0191036 100644 --- a/openstack/common/utils.py +++ b/openstack/common/utils.py @@ -55,7 +55,7 @@ def bool_from_string(subject): Interpret a string as a boolean. Any string value in: - ('True', 'true', 'On', 'on', '1') + ('True', 'true', 'On', 'on', 'Yes', 'yes', '1') is interpreted as a boolean True. Useful for JSON-decoded stuff and config file parsing @@ -63,7 +63,7 @@ def bool_from_string(subject): if isinstance(subject, bool): return subject if isinstance(subject, basestring): - if subject.strip().lower() in ('true', 'on', '1'): + if subject.strip().lower() in ('true', 'on', 'yes', '1'): return True return False |
