I'm following the Developing Modules guide to get myself started with
Ansible hacking
(http://docs.ansible.com/ansible/dev_guide/developing_modules.html).
I've sourced hacking/env-setup and now I'm simply trying to use test-module
to test an original unedited module.
The module I'm trying to test is 'virt', under extras/cloud/extra. It has a
python dependency: libvirt-python. This dependency has been installed and I
can open a Python terminal and import 'libvirt' without a problem.
root@9ba2749b80b0:/code# python2
Python 2.7.12 (default, Nov 17 2016, 22:18:11)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>>
However, when using test-module to test 'virt', it seems unable to import
'libvirt':
root@9ba2749b80b0:/code# hacking/test-module -m
lib/ansible/modules/extras/cloud/misc/virt.py
* including generated source, if any, saving to:
/root/.ansible_module_generated
* ansiballz module detected; extracted module source to: /root/debug_dir
***********************************
RAW OUTPUT
{"msg": "The `libvirt` module is not importable. Check the requirements.",
"failed": true, "invocation": {"module_args": {"xml": null, "state": null,
"command": null, "name": null, "uri": "qemu:///system"}}}
***********************************
PARSED OUTPUT
{
"failed": true,
"invocation": {
"module_args": {
"command": null,
"name": null,
"state": null,
"uri": "qemu:///system",
"xml": null
}
},
"msg": "The `libvirt` module is not importable. Check the requirements."
}
I must be missing something here... Does anyone have a hint as to what
could be the problem?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/eee97439-fac0-4986-93e1-3412273530ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.