issue #555: ansible: workaround ancient reload(sys) hack.
This is the most minimal change for what might be relatively minimal edge case. Alternative is replacing reload(), but let's not do that yet. Closes #555pull/564/head
parent
30b8172573
commit
2bd0bbd4df
@ -0,0 +1,10 @@
|
|||||||
|
# issue #555
|
||||||
|
|
||||||
|
- name: integration/runner/custom_python_prehistoric_module.yml
|
||||||
|
hosts: test-targets
|
||||||
|
any_errors_fatal: true
|
||||||
|
tasks:
|
||||||
|
- custom_python_prehistoric_module:
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- assert: that=out.ok
|
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# issue #555: I'm a module that cutpastes an old hack.
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
from ansible.module_utils.basic import get_module_path
|
||||||
|
from ansible.module_utils import six
|
||||||
|
|
||||||
|
import os
|
||||||
|
import pwd
|
||||||
|
import socket
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import sys
|
||||||
|
reload(sys)
|
||||||
|
sys.setdefaultencoding('utf8')
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
module = AnsibleModule(argument_spec={})
|
||||||
|
module.exit_json(ok=True)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Reference in New Issue