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

Refactor usage of type() (#3412)

Addresses https://github.com/ansible/ansible/issues/18440
This commit is contained in:
jctanner 2016-11-09 18:59:21 -05:00 committed by Matt Clay
parent e44362b6f8
commit 46174588ca

View file

@ -285,7 +285,8 @@ class OSXDefaults(object):
return True
# There is a type mismatch! Given type does not match the type in defaults
if self.current_value is not None and not isinstance(self.current_value, type(self.value)):
value_type = type(self.value)
if self.current_value is not None and not isinstance(self.current_value, value_type):
raise OSXDefaultsException("Type mismatch. Type in defaults: " + type(self.current_value).__name__)
# Current value matches the given value. Nothing need to be done. Arrays need extra care