diff options
Diffstat (limited to 'openstack/common/utils.py')
| -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 3400675..cbc45fd 100644 --- a/openstack/common/utils.py +++ b/openstack/common/utils.py @@ -60,9 +60,9 @@ def bool_from_string(subject): Useful for JSON-decoded stuff and config file parsing """ - if type(subject) == type(bool): + if isinstance(subject, types.BooleanType): return subject - if hasattr(subject, 'startswith'): # str or unicode... + if isinstance(subject, types.StringTypes): if subject.strip().lower() in ('true', 'on', '1'): return True return False |
