diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-02-03 14:01:58 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-02-03 14:01:58 +0000 |
commit | fceed501895107c1def893c38d88e435d81d5a12 (patch) | |
tree | eb738a9d8290db3a886be5f68d3427a9e5b41031 /nova/utils.py | |
parent | 5d490117cd31b5e11a5746d5124fb343f0749c02 (diff) | |
parent | 795d1bcfd13aae2d07f52a2a1a51117e78a234c8 (diff) | |
download | nova-fceed501895107c1def893c38d88e435d81d5a12.tar.gz nova-fceed501895107c1def893c38d88e435d81d5a12.tar.xz nova-fceed501895107c1def893c38d88e435d81d5a12.zip |
Merge "Tweakify is_valid_boolstr()."
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/nova/utils.py b/nova/utils.py index cb75709ad..e4d708f5c 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -876,11 +876,8 @@ def is_int_like(val): def is_valid_boolstr(val): """Check if the provided string is a valid bool string or not.""" - val = str(val).lower() - return val == 'true' or val == 'false' or \ - val == 'yes' or val == 'no' or \ - val == 'y' or val == 'n' or \ - val == '1' or val == '0' + boolstrs = ('true', 'false', 'yes', 'no', 'y', 'n', '1', '0') + return str(val).lower() in boolstrs def is_valid_ipv4(address): |