community.general/tests/unit/plugins/inventory
patchback[bot] fc7609628e
[PR #8532/24b74cc4 backport][stable-9] opennebula inventory: add VM ID and VM host to data (#9003)
opennebula inventory: add VM ID and VM host to data (#8532)

* Add VM id and VM host to opennebula inventory data

##### SUMMARY
<!--- Describe the change below, including rationale and design decisions --> 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

<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->

<!--- Please do not forget to include a changelog fragment:
      https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-changelog-fragments
      No need to include one for docs-only or test-only PR, and for new plugin/module PRs.
      Read about more details in CONTRIBUTING.md.
      -->

##### ISSUE TYPE
<!--- Pick one or more below and delete the rest.
      'Test Pull Request' is for PRs that add/extend tests without code changes. -->
- Feature Pull Request

##### COMPONENT NAME
<!--- Write the SHORT NAME of the module, plugin, task or feature below. --> opennebula.py

##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here --> <!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->

<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
                "host": "foo23.host",
                "id": 1234,
```

* Create 8532-expand-opennuebula-inventory-data.yml

* Update opennebula.py

* Update changelogs/fragments/8532-expand-opennuebula-inventory-data.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add check for empty records and add test

* fix attribute test

* fix attribute test

* fix attribute test

* fix attribute test

* Update plugins/inventory/opennebula.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* update as per guidance

* restore attribute checks

* fix attr

* fix indent

* PR Fixes

* add attribute check in case of empty variable

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Александр Бакановский <abakanovskii@astralinux.ru>
(cherry picked from commit 24b74cc4b9)

Co-authored-by: Tom Paine <github@aioue.net>
2024-10-07 23:10:38 +02:00
..
fixtures Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test_cobbler.py Remove unnecessary test imports (#5978) 2023-02-12 21:05:08 +01:00
test_icinga2.py Adds group_by_hostgroups parameter to Icinga2 inventory (#7998) 2024-03-24 17:01:34 +00:00
test_linode.py Add descriptive error message to Linode inventory plugin file checkin… (#8133) 2024-03-24 22:22:44 +01:00
test_lxd.py Remove unnecessary test imports (#5978) 2023-02-12 21:05:08 +01:00
test_opennebula.py [PR #8532/24b74cc4 backport][stable-9] opennebula inventory: add VM ID and VM host to data (#9003) 2024-10-07 23:10:38 +02:00
test_proxmox.py [PR #8713/0f59bb7a backport][stable-9] Get interfaces for Proxmox LXC containers (#8750) 2024-08-12 08:07:31 +02:00
test_stackpath_compute.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) 2022-08-05 12:28:29 +02:00
test_xen_orchestra.py [PR #8720/9a16eaf9 backport][stable-9] Fix pylint and pep8 issues exposed by latest ansible-core's ansible-test sanity checks (#8722) 2024-08-07 15:49:06 +02:00