Skip to content

Commit

Permalink
Refactor usage of type() (ansible#3412)
Browse files Browse the repository at this point in the history
Addresses ansible#18440
  • Loading branch information
jctanner authored and mattclay committed Dec 8, 2016
1 parent e44362b commit 4617458
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ansible/modules/extras/system/osx_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ def run(self):
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
Expand Down

0 comments on commit 4617458

Please sign in to comment.