Merge "Use instanceof instead of type"
This commit is contained in:
@@ -351,7 +351,7 @@ def _merge_args(qCmd, parsed_args, _extra_values, value_specs):
|
||||
if isinstance(arg_value, list):
|
||||
if value and isinstance(value, list):
|
||||
if (not arg_value or
|
||||
type(arg_value[0]) == type(value[0])):
|
||||
isinstance(arg_value[0], type(value[0]))):
|
||||
arg_value.extend(value)
|
||||
_extra_values.pop(key)
|
||||
|
||||
|
@@ -185,7 +185,7 @@ class ClientBase(object):
|
||||
# Add format and tenant_id
|
||||
action += ".%s" % self.format
|
||||
action = self.action_prefix + action
|
||||
if type(params) is dict and params:
|
||||
if isinstance(params, dict) and params:
|
||||
params = utils.safe_encode_dict(params)
|
||||
action += '?' + urlparse.urlencode(params, doseq=1)
|
||||
|
||||
@@ -216,7 +216,7 @@ class ClientBase(object):
|
||||
"""
|
||||
if data is None:
|
||||
return None
|
||||
elif type(data) is dict:
|
||||
elif isinstance(data, dict):
|
||||
return serializer.Serializer().serialize(data)
|
||||
else:
|
||||
raise Exception(_("Unable to serialize object of type = '%s'") %
|
||||
|
Reference in New Issue
Block a user