ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
784 stars 1.45k forks source link

Add VM id and VM host to opennebula inventory data #8532

Open aioue opened 2 weeks ago

aioue commented 2 weeks ago
SUMMARY
To enable greater use of the inventory, add the ID of the VM, and the hostname of the host the VM is running on to the inventory output
ISSUE TYPE
COMPONENT NAME
opennebula.py ##### ADDITIONAL INFORMATION
                "host": "foo23.host",
                "id": 1234,
ansibullbot commented 2 weeks ago

cc @feldsam click here for bot help

aioue commented 2 weeks ago

Not sure why the tests are failing as I'm not adding a new import for the pyone library...?

feldsam commented 1 week ago

Hi, problem is, that you added new method which is calling pyone package. To pass test, you need to also update tests to reflect this.

Anyway, for such infromation - host on which is VM running, there is easier method to get this. It is already in VM object, in history records, you just need to get last history record of VM to get host. So no need to do aditional api call and searching for host.

aioue commented 1 day ago

@feldsam updated PR to reflect the new information you provided. It's a very simple PR now!

I'm afraid I don't understand how to fix the tests.