-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OpenNebula inventory crash when NIC does not have IP #8489
Conversation
Match IPv6 behaviour. When a NIC does not have an IP: File "ansible/inventory/manager.py", line 292, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "ansible-cm/plugins/inventory/opennebula.py", line 263, in parse self._populate() File "ansible-cm/plugins/inventory/opennebula.py", line 226, in _populate servers = self._retrieve_servers(filter_by_label) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 210, in _retrieve_servers server['v4_first_ip'] = self._get_vm_ipv4(vm) ^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 154, in _get_vm_ipv4 return net['IP']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Can you please add a changelog fragment? Thanks.
Updated as per your suggestion and changelog fragment added. Thank you for your review. |
changelogs/fragments/8489-fix-opennebula-inventory-crash-when-nic-has-no-ip.yml
Outdated
Show resolved
Hide resolved
I'll merge tomorrow if nobody objects. |
Backport to stable-8: 💚 backport PR created✅ Backport PR branch: Backported as #8518 🤖 @patchback |
* Fix OpenNebula inventory crash when NIC does not have IP Match IPv6 behaviour. When a NIC does not have an IP: File "ansible/inventory/manager.py", line 292, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "ansible-cm/plugins/inventory/opennebula.py", line 263, in parse self._populate() File "ansible-cm/plugins/inventory/opennebula.py", line 226, in _populate servers = self._retrieve_servers(filter_by_label) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 210, in _retrieve_servers server['v4_first_ip'] = self._get_vm_ipv4(vm) ^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 154, in _get_vm_ipv4 return net['IP'] * Update to call to match IPv6 and add changelog fragment * Update changelog fragment. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3716187)
Backport to stable-9: 💚 backport PR created✅ Backport PR branch: Backported as #8519 🤖 @patchback |
* Fix OpenNebula inventory crash when NIC does not have IP Match IPv6 behaviour. When a NIC does not have an IP: File "ansible/inventory/manager.py", line 292, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "ansible-cm/plugins/inventory/opennebula.py", line 263, in parse self._populate() File "ansible-cm/plugins/inventory/opennebula.py", line 226, in _populate servers = self._retrieve_servers(filter_by_label) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 210, in _retrieve_servers server['v4_first_ip'] = self._get_vm_ipv4(vm) ^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 154, in _get_vm_ipv4 return net['IP'] * Update to call to match IPv6 and add changelog fragment * Update changelog fragment. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3716187)
@aioue thanks for your contribution! |
… when NIC does not have IP (#8518) Fix OpenNebula inventory crash when NIC does not have IP (#8489) * Fix OpenNebula inventory crash when NIC does not have IP Match IPv6 behaviour. When a NIC does not have an IP: File "ansible/inventory/manager.py", line 292, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "ansible-cm/plugins/inventory/opennebula.py", line 263, in parse self._populate() File "ansible-cm/plugins/inventory/opennebula.py", line 226, in _populate servers = self._retrieve_servers(filter_by_label) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 210, in _retrieve_servers server['v4_first_ip'] = self._get_vm_ipv4(vm) ^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 154, in _get_vm_ipv4 return net['IP'] * Update to call to match IPv6 and add changelog fragment * Update changelog fragment. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3716187) Co-authored-by: Tom Paine <[email protected]>
… when NIC does not have IP (#8519) Fix OpenNebula inventory crash when NIC does not have IP (#8489) * Fix OpenNebula inventory crash when NIC does not have IP Match IPv6 behaviour. When a NIC does not have an IP: File "ansible/inventory/manager.py", line 292, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "ansible-cm/plugins/inventory/opennebula.py", line 263, in parse self._populate() File "ansible-cm/plugins/inventory/opennebula.py", line 226, in _populate servers = self._retrieve_servers(filter_by_label) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 210, in _retrieve_servers server['v4_first_ip'] = self._get_vm_ipv4(vm) ^^^^^^^^^^^^^^^^^^^^^ File "ansible-cm/plugins/inventory/opennebula.py", line 154, in _get_vm_ipv4 return net['IP'] * Update to call to match IPv6 and add changelog fragment * Update changelog fragment. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3716187) Co-authored-by: Tom Paine <[email protected]>
SUMMARY
Fix OpenNebula inventory crash when NIC does not have IP.
Now matches IPv6 behaviour.
ISSUE TYPE
community.general.opennebula
ADDITIONAL INFORMATION
When a NIC does not have an IP: