diff options
| author | Jason Kölker <jason@koelker.net> | 2011-12-01 17:21:38 -0600 |
|---|---|---|
| committer | Jason Kölker <jason@koelker.net> | 2011-12-01 17:21:38 -0600 |
| commit | 3bbeb69487c70aa9ebc7fa69c93d6e3544a3aa68 (patch) | |
| tree | bdd95228215d89278624192b31e0dd753feab341 /openstack | |
| parent | 146c23070c13f03b6d0e2ccbe33fa7c892119d65 (diff) | |
| download | oslo-3bbeb69487c70aa9ebc7fa69c93d6e3544a3aa68.tar.gz oslo-3bbeb69487c70aa9ebc7fa69c93d6e3544a3aa68.tar.xz oslo-3bbeb69487c70aa9ebc7fa69c93d6e3544a3aa68.zip | |
use isinstance and types.*
Diffstat (limited to 'openstack')
| -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 |
