From 46174588ca0adbbc07aa60bd036c76ba0c6d3c09 Mon Sep 17 00:00:00 2001 From: jctanner Date: Wed, 9 Nov 2016 18:59:21 -0500 Subject: [PATCH] Refactor usage of type() (#3412) Addresses https://github.com/ansible/ansible/issues/18440 --- lib/ansible/modules/extras/system/osx_defaults.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/osx_defaults.py b/lib/ansible/modules/extras/system/osx_defaults.py index 7cc481232e1689..0b1b57949f8a01 100644 --- a/lib/ansible/modules/extras/system/osx_defaults.py +++ b/lib/ansible/modules/extras/system/osx_defaults.py @@ -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