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

Gather vm´s in a folder results in AttributeError: 'NoneType' object has no attribute 'ipAddress' #1942

Closed
IncredibleRichie opened this issue Dec 4, 2023 · 1 comment

Comments

@IncredibleRichie
Copy link

SUMMARY

Can not gather vms in a folder since i´ve updated our container based on Arch
When i try to execute this in a eg. RHEL it works.
I think the python version could be to "new "

Any hints how to solve this are appreciated

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.vmware.vmware_vm_info:

ANSIBLE VERSION
ansible [core 2.16.0]
python version = 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801] (/usr/bin/python)
jinja version = 3.1.2
COLLECTION VERSION
community.vmware              4.0.0  
CONFIGURATION
Pipelining and Host key check
OS / ENVIRONMENT

Arch Linux

STEPS TO REPRODUCE
    - name: Gather all VMs from "{{ delfolder }}"
      community.vmware.vmware_vm_info:
        hostname: "{{ vcenter_hostname }}"
        username: "{{ vcenter_username }}"
        password: "{{ vcenter_password }}"
        folder: "{{ delfolder }}"
        validate_certs: false
      delegate_to: localhost
      register: vm_info
EXPECTED RESULTS

Data of all hosts in a folder

ACTUAL RESULTS
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'ipAddress'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 107, in <module>\n  File \"<stdin>\", line 99, in _ansiballz_main\n  File \"<stdin>\", line 47, in invoke_module\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_7c0_zmhh/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 475, in <module>\n  File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_7c0_zmhh/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 469, in main\n  File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_7c0_zmhh/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 355, in get_virtual_machines\nAttributeError: 'NoneType' object has no attribute 'ipAddress'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@mariolenz
Copy link
Collaborator

mariolenz commented Dec 5, 2023

This looks familiar.

I'm pretty sure this has been fixed in #1919. Please test with 4.0.1 and, if you still run into this, re-open this issue or open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants