-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
VMware: Fix KeyError in vmware_host_config_manager #52736
Conversation
@mariolenz, just so you are aware we have a dedicated Working Group for vmware. |
@mariolenz Thanks for the PR. Could you please add a changelog fragment like this ? |
I've added a changelog fragment and squashed the commit with the previous one because I didn't want to clutter your commit history. Hope it's OK now, otherwise just tell me :-) |
changelogs/fragments/44561-vmware_host_config_manager-fix_key_error.yml
Outdated
Show resolved
Hide resolved
…error.yml Co-Authored-By: mariolenz <m@riolenz.de>
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
@pdellaert @dericcrago @Im0 @ckotte @jeking3 @Tomorrow9 Could you please review this ? |
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
@mariolenz Thanks for the contribution. @pdellaert Thanks for the review. |
SUMMARY
option_manager.supportedOption may return options that aren't set which results in a KeyError
Fixes #44561
ISSUE TYPE
COMPONENT NAME
vmware_host_config_manager
ADDITIONAL INFORMATION
The problem is that first all options that are set are retrieved and then this list is updated with every option's type. When 'Vpx.Vpxa.config.log.level' is supported but not set, this results in a KeyError because
host_facts[Vpx.Vpxa.config.log.level']
doesn't exist.I think it is better to first get a list of all supported options and then update this list with every option's actual value.