summaryrefslogtreecommitdiffstats
path: root/openstack/common
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-03-30 08:35:32 +0000
committerGerrit Code Review <review@openstack.org>2012-03-30 08:35:32 +0000
commitc0541b1ea0a96cb7373112dbfd66484a5c7b674d (patch)
treeb299ba3206d4a6469eb43193e2acc6049f9ad0fc /openstack/common
parentf6cd8b79deb1f0ae3a132b67727afa0ab786e9ba (diff)
parent34343acba97f41535b2e75866f99d58e44da088d (diff)
downloadoslo-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.py4
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