We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90105e2 commit a1f2ec2Copy full SHA for a1f2ec2
tests/ansible/lib/modules/custom_python_uses_distro.py
@@ -2,12 +2,20 @@
2
# issue #590: I am an Ansible new-style Python module that tries to use
3
# ansible.module_utils.distro.
4
5
+import ansible
6
from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils import distro
7
+
8
+if ansible.__version__ > '2.8':
9
+ from ansible.module_utils import distro
10
+else:
11
+ distro = None
12
13
def main():
14
module = AnsibleModule(argument_spec={})
- module.exit_json(info=distro.info())
15
+ if ansible.__version__ > '2.8':
16
+ module.exit_json(info=distro.info())
17
+ else:
18
+ module.exit_json(info={'id': None})
19
20
if __name__ == '__main__':
21
main()
0 commit comments