1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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.
This commit is contained in:
Marius Gedminas 2015-09-23 09:53:36 +03:00
parent e71a986e16
commit f5d4935197

View file

@ -1354,7 +1354,7 @@ class AnsibleModule(object):
if not 'changed' in kwargs: if not 'changed' in kwargs:
kwargs['changed'] = False kwargs['changed'] = False
self.do_cleanup_files() self.do_cleanup_files()
print self.jsonify(kwargs) print(self.jsonify(kwargs))
sys.exit(0) sys.exit(0)
def fail_json(self, **kwargs): 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" assert 'msg' in kwargs, "implementation error -- msg to explain the error is required"
kwargs['failed'] = True kwargs['failed'] = True
self.do_cleanup_files() self.do_cleanup_files()
print self.jsonify(kwargs) print(self.jsonify(kwargs))
sys.exit(1) sys.exit(1)
def is_executable(self, path): def is_executable(self, path):