-
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
virtualbox: Fix crash when handling deeply nested hostvars #5348
virtualbox: Fix crash when handling deeply nested hostvars #5348
Conversation
- Skip parsing values with keys that have both a value and nested data. - Skip parsing values that are nested more than two keys deep.
ae96b1d
to
7625757
Compare
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 a lot for creating this PR! I have a small comment regarding the changelog fragment, besides that the change looks good to me. (I'm not using the plugin, so I cannot test it though.)
Co-authored-by: Felix Fontein <[email protected]>
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
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.
Looks good as far as I can judge it.
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.
LGTM
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #5381 🤖 @patchback |
@basicdays thanks for your contribution! |
* virtualbox: Fix nested data parsing - Skip parsing values with keys that have both a value and nested data. - Skip parsing values that are nested more than two keys deep. * Update changelogs/fragments/5348-fix-vbox-deeply-nested-hostvars.yml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit b0bb994)
…5381) * virtualbox: Fix nested data parsing - Skip parsing values with keys that have both a value and nested data. - Skip parsing values that are nested more than two keys deep. * Update changelogs/fragments/5348-fix-vbox-deeply-nested-hostvars.yml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit b0bb994) Co-authored-by: Paul Sanchez <[email protected]>
…ollections#5348) * virtualbox: Fix nested data parsing - Skip parsing values with keys that have both a value and nested data. - Skip parsing values that are nested more than two keys deep. * Update changelogs/fragments/5348-fix-vbox-deeply-nested-hostvars.yml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
…ollections#5348) * virtualbox: Fix nested data parsing - Skip parsing values with keys that have both a value and nested data. - Skip parsing values that are nested more than two keys deep. * Update changelogs/fragments/5348-fix-vbox-deeply-nested-hostvars.yml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
…ollections#5348) * virtualbox: Fix nested data parsing - Skip parsing values with keys that have both a value and nested data. - Skip parsing values that are nested more than two keys deep. * Update changelogs/fragments/5348-fix-vbox-deeply-nested-hostvars.yml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
SUMMARY
Fixes #5332
Skip parsing values with keys that have both a value and nested data. Skip parsing values that are nested more than two keys deep.
ISSUE TYPE
COMPONENT NAME
virtualbox
ADDITIONAL INFORMATION
Taken from the issue, calling
ansible all -i vbox.yml --list -vvv
produces an error that contains the following:This occurs when a virtualbox instance from the command
VBoxManage showvminfo <uuid|vmname>
has a key with both a value and nested data. This can be seen with the following vminfo segment:This fix now ignores the
Recording screens
value of1
. In addition, the nested information underScreen 0
is ignored.This results in a
hostvars
dictionary of:Since the
showvminfo
is using a human readable output, I am not certain how nested data is formatted across the various Virtualbox versions. Because of that, I've decided to just skip deeply nested data. Another avenue to pull informationabout a vm instance could be using
VBoxManage showvminfo --machinereadable <uuid|vmname>
instead. Howeverthe data keys would change, meaning this would be a breaking change.
For reference, the following is the same information with the
machinereadable
option: