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

Making sure that the key value is converted to a string to avoid concatenation errors #37445

Merged

Conversation

johnroach
Copy link
Contributor

SUMMARY

VMWare for certain custom attributes returns some key's as a number. This causes the vmware_inventory.py script to fail when concatenating the values to produce a group name for the VMWare inventory.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

vmware_inventory tool

ANSIBLE VERSION
ansible 2.4.3.0
  config file = None
  configured module search path = [u'/Users/jroach/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
ADDITIONAL INFORMATION

Steps for reproduction:
1- Create a custom attribute using the VMWare's interface
2- Choose to group by custom attribute in your vmware_inventory.ini file
3- Try to execute vmware_inventory.py file
4- Custom attribute groups won't show

Example host meta data: {'dynamictype': None, 'dynamicproperty': [], 'value': 'jenkins', 'key': 102}
Run result after change:
{'vmware102_jenkins': {'hosts': ['someawesomehost']}}

@ansibot ansibot added bug This issue/PR relates to a bug. c:inventory/contrib_script cloud inventory Inventory category 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 Mar 15, 2018
@johnroach johnroach changed the title Making sure that the key value returns a string to avoid concatenation Making sure that the key value returns a string to avoid concatenation errors Mar 15, 2018
@johnroach johnroach changed the title Making sure that the key value returns a string to avoid concatenation errors Making sure that the key value is converted to a string to avoid concatenation errors Mar 15, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Mar 15, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 23, 2018
@johnroach
Copy link
Contributor Author

@jborean93 when can this get merged in?

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

Akasurde commented Apr 5, 2018

rebuild_merge

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 5, 2018
@ansibot ansibot merged commit 3f2c909 into ansible:devel Apr 5, 2018
@Akasurde
Copy link
Member

Akasurde commented Apr 6, 2018

@johnroach Thanks for the contribution.

ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. c:inventory/contrib_script cloud inventory Inventory category 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants