Debian Codegraph @

tests/ansible/lib/modules/custom_python_prehistoric_module.py

raw
1 #!/usr/bin/python
2
3 # Test functionality of ansible_mitogen.runner.PREHISTORIC_HACK_RE, which
4 # removes `reload(sys); sys.setdefaultencoding(...)` from an Ansible module
5 # as it is sent to a target. There are probably very few modules in the wild
6 # that still do this, reload() is a Python 2.x builtin function.
7 # issue #555: I'm a module that cutpastes an old hack.
8
9 from ansible.module_utils.basic import AnsibleModule
10
11 import sys
12 reload(sys)
13 sys.setdefaultencoding('utf8')
14
15
16 def main():
17 module = AnsibleModule(argument_spec={})
18 module.exit_json(ok=True)
19
20 if __name__ == '__main__':
21 main()