Skip to content
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

Merged
merged 2 commits into from
Feb 25, 2019

Conversation

mariolenz
Copy link
Contributor

SUMMARY

option_manager.supportedOption may return options that aren't set which results in a KeyError

Fixes #44561

ISSUE TYPE
  • Bugfix Pull Request
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.

@ansibot
Copy link
Contributor

ansibot commented Feb 21, 2019

@ansibot
Copy link
Contributor

ansibot commented Feb 21, 2019

@mariolenz, just so you are aware we have a dedicated Working Group for vmware.
You can find other people interested in this in #ansible-vmware on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community labels Feb 21, 2019
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Feb 22, 2019
@Akasurde Akasurde changed the title Bug fix for vmware_host_config_manager VMware: Fix KeyError in vmware_host_config_manager Feb 22, 2019
@Akasurde
Copy link
Member

Akasurde commented Feb 22, 2019

@mariolenz Thanks for the PR. Could you please add a changelog fragment like this ?

@mariolenz
Copy link
Contributor Author

@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 :-)

…error.yml

Co-Authored-By: mariolenz <m@riolenz.de>
Copy link
Member

@Akasurde Akasurde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Akasurde
Copy link
Member

@pdellaert @dericcrago @Im0 @ckotte @jeking3 @Tomorrow9 Could you please review this ?

Copy link
Contributor

@pdellaert pdellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Feb 25, 2019
@Akasurde Akasurde merged commit bcd6702 into ansible:devel Feb 25, 2019
@Akasurde
Copy link
Member

@mariolenz Thanks for the contribution. @pdellaert Thanks for the review.

@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent results with vmware_host_config_manager
4 participants