-
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
Unable to parse virtualbox inventory file "'str' object does not support item assignment" #5332
Comments
Files identified in the description: If these files are incorrect, please update the |
@ansibullbot !component +plugins/inventory/virtualbox.py |
Just ran into this as well. I'm running VirtualBox version 6.1.38 on MacOS 12.6. I did some sleuthing of the code with a bunch of print statements and found that the logic to parse the
It seems since In addition, it seems it's a double nested dictionary, so not sure if that's being handled correctly either. As a temporary fix, I just edited
It doesn't handle the double nested information correctly, but it at least doesn't cause the whole thing to blow up. |
@basicdays want to create a PR for that (with a changelog fragment)? While this isn't a great long-term fix (as you noted), at least it makes it restores basic functionality short-term :) |
@felixfontein Yeah I can do that, I was actually just looking into the process to do a PR for this. |
@basicdays thanks for looking into that. I did start debugging, but when I suspected it had to do with parsing, I gave up. Is it specific to a version of VirtualBox? Edit: I saw you mentioned you didn't know which version is affected in the PR. |
@notetiene Yeah not sure which version. My guess is this change in information format might have started with version 6.1 perhaps. |
Summary
I'm unable to get the virtualbox inventory using the
community.general.virtualbox
module.Issue Type
Bug Report
Component Name
virtualbox
Ansible Version
Community.general Version
Configuration
OS / Environment
Ubuntu 20.04
Linux P50 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Steps to Reproduce
When I try to load a VIrtualBox inventory with the following example:
vbox.yml
Doing the following command:
I get:
Where:
is what we want.
Expected Results
I would expect to get a valid VirtualBox inventory.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: