mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Replace type() checks with isinstance()
Fixes the bug I introduced in my previous commit (six.string_types is (basestring,) on Python 2). Thanks @abadger for noticing!
This commit is contained in:
parent
37be9539ff
commit
0eb0b56722
1 changed files with 3 additions and 3 deletions
|
@ -260,11 +260,11 @@ class LibcloudInventory(object):
|
|||
key = self.to_safe('ec2_' + key)
|
||||
|
||||
# Handle complex types
|
||||
if type(value) in [int, bool]:
|
||||
if isinstance(value, (int, bool)):
|
||||
instance_vars[key] = value
|
||||
elif type(value) in string_types:
|
||||
elif isinstance(value, string_types):
|
||||
instance_vars[key] = value.strip()
|
||||
elif type(value) == type(None):
|
||||
elif value is None:
|
||||
instance_vars[key] = ''
|
||||
elif key == 'ec2_region':
|
||||
instance_vars[key] = value.name
|
||||
|
|
Loading…
Reference in a new issue