diff --git a/lib/ansible/plugins/lookup/mongodb.py b/lib/ansible/plugins/lookup/mongodb.py index 2605d4e3edd..dff4a7bbecc 100644 --- a/lib/ansible/plugins/lookup/mongodb.py +++ b/lib/ansible/plugins/lookup/mongodb.py @@ -89,7 +89,7 @@ EXAMPLES: from __future__ import (absolute_import, division, print_function) from __future__ import unicode_literals -from ansible.module_utils.six import string_types +from ansible.module_utils.six import string_types, integer_types import datetime __metaclass__ = type @@ -139,7 +139,7 @@ class LookupModule(LookupBase): def convert_mongo_result_to_valid_json(self, result): if result is None: return result - if isinstance(result, (int, long, float, bool)): + if isinstance(result, integer_types + (float, bool)): return result if isinstance(result, string_types): return result