From f5d49351977361191f56c9eecfa7698564f40c6c Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Wed, 23 Sep 2015 09:53:36 +0300 Subject: [PATCH] Python 3: treat python as a function in module_utils/basic.py NB: we can't use 'from __future__ import print_function', but luckily print(one_thing) works fine on both Python 2 and Python 3 without that. --- lib/ansible/module_utils/basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 93a0fba0636..9cb7cfa2f32 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1354,7 +1354,7 @@ class AnsibleModule(object): if not 'changed' in kwargs: kwargs['changed'] = False self.do_cleanup_files() - print self.jsonify(kwargs) + print(self.jsonify(kwargs)) sys.exit(0) def fail_json(self, **kwargs): @@ -1363,7 +1363,7 @@ class AnsibleModule(object): assert 'msg' in kwargs, "implementation error -- msg to explain the error is required" kwargs['failed'] = True self.do_cleanup_files() - print self.jsonify(kwargs) + print(self.jsonify(kwargs)) sys.exit(1) def is_executable(self, path):