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:
parent
e44362b6f8
commit
46174588ca
1 changed files with 2 additions and 1 deletions
|
@ -285,7 +285,8 @@ class OSXDefaults(object):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# There is a type mismatch! Given type does not match the type in defaults
|
# 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__)
|
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
|
# Current value matches the given value. Nothing need to be done. Arrays need extra care
|
||||||
|
|
Loading…
Add table
Reference in a new issue