diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-02-23 08:50:24 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-02-23 08:50:24 +0000 |
| commit | 02e5b6f41d2b5f026ce1f1f5b7026d5968a7c20f (patch) | |
| tree | 4e65880d9cbe6de2112b6d83fbf755a270f59c9f /openstackclient/api/api.py | |
| parent | db4d73d8c8c3471df2f515d2881e121f456678d9 (diff) | |
| parent | 11a8f911affe10bacce41ad3474a28aff3417ec3 (diff) | |
| download | python-openstackclient-02e5b6f41d2b5f026ce1f1f5b7026d5968a7c20f.tar.gz | |
Merge "Use instanceof instead of type"
Diffstat (limited to 'openstackclient/api/api.py')
| -rw-r--r-- | openstackclient/api/api.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openstackclient/api/api.py b/openstackclient/api/api.py index 97eb7e4a..6a88e7f7 100644 --- a/openstackclient/api/api.py +++ b/openstackclient/api/api.py @@ -243,14 +243,14 @@ class BaseAPI(KeystoneSession): def getlist(kw): """Do list call, unwrap resource dict if present""" ret = self.list(path, **kw) - if type(ret) == dict and resource in ret: + if isinstance(ret, dict) and resource in ret: ret = ret[resource] return ret # Search by attribute kwargs = {attr: value} data = getlist(kwargs) - if type(data) == dict: + if isinstance(data, dict): return data if len(data) == 1: return data[0] @@ -283,7 +283,7 @@ class BaseAPI(KeystoneSession): """ items = self.list(path) - if type(items) == dict: + if isinstance(items, dict): # strip off the enclosing dict key = list(items.keys())[0] items = items[key] |
