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_vm_facts: Add error check for config.vm #31629

Merged
merged 1 commit into from
Oct 12, 2017

Conversation

ZubairLK
Copy link
Contributor

@ZubairLK ZubairLK commented Oct 12, 2017

Add a simple check to see if vm.config exists before looking for
vm.config.hardware

SUMMARY

I had a dangling inaccessible VM in my host which didn't return a mac address.
This resulted in an error:
'NoneType' object has no attribute 'hardware'
which I traced to this section as vm.config was None.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ANSIBLE VERSION
ansible 2.4.0.0
  config file = None
  configured module search path = ['/home/zkakakhel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.5/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609]
ADDITIONAL INFORMATION

Add a simple check to see if vm.config exists before looking for
vm.config.hardware
@ansibot
Copy link
Contributor

ansibot commented Oct 12, 2017

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bugfix_pull_request 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. support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community python3 labels Oct 12, 2017
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Oct 12, 2017
@samdoran samdoran merged commit 4034630 into ansible:devel Oct 12, 2017
BondAnthony pushed a commit to BondAnthony/ansible that referenced this pull request Oct 14, 2017
Add a simple check to see if vm.config exists before looking for
vm.config.hardware
mtb-xt pushed a commit to mtb-xt/ansible that referenced this pull request Oct 15, 2017
Add a simple check to see if vm.config exists before looking for
vm.config.hardware
@abadger
Copy link
Contributor

abadger commented Oct 18, 2017

Cherry-picked for 2.4.1rc2

@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 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. python3 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.

4 participants