1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Use six to check for string_types

This commit is contained in:
Paul Logston 2015-04-25 19:45:22 -04:00
parent 50932ce556
commit e8768b2b87

View file

@ -694,9 +694,7 @@ class Ec2Inventory(object):
instance_vars['ec2_previous_state_code'] = instance.previous_state_code
elif type(value) in [int, bool]:
instance_vars[key] = value
elif six.PY2 and type(value) in [str, unicode]:
instance_vars[key] = value.strip()
elif six.PY3 and type(value) in [str]:
elif isinstance(value, six.string_types):
instance_vars[key] = value.strip()
elif type(value) == type(None):
instance_vars[key] = ''