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

ucs_san_connectivity using loop to add vhba_list fails with NoneType object error #121

Open
gve-vse-tim opened this issue Nov 28, 2019 · 3 comments

Comments

@gve-vse-tim
Copy link

When populating the vhba_list using a loop, the first item in the loop appears to work just fine but the subsequent items in the loop fail with the following error message (first successful and second failed items in the included output):

TASK [Create SAN Connectivity Policies with Loops] *****************************
changed: [ucspe-local] => (item={'order': '1', 'name': 'bootA', 'template': 'vhba-boot-A', 'policy': 'VMWare'})
failed: [ucspe-local] (item={'order': '2', 'name': 'bootB', 'template': 'vhba-boot-B', 'policy': 'VMWare'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "bootB", "order": "2", "policy": "VMWare", "template": "vhba-boot-B"}, "msg": "setup error: 'NoneType' object has no attribute 'check_prop_match' "}

Re-running the playbook does not affect the behavior (other than the first item reporting "ok" rather than changed:

TASK [Create SAN Connectivity Policies with Loops] *****************************
ok: [ucspe-local] => (item={'order': '1', 'name': 'bootA', 'template': 'vhba-boot-A', 'policy': 'VMWare'})
failed: [ucspe-local] (item={'order': '2', 'name': 'bootB', 'template': 'vhba-boot-B', 'policy': 'VMWare'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "bootB", "order": "2", "policy": "VMWare", "template": "vhba-boot-B"}, "msg": "setup error: 'NoneType' object has no attribute 'check_prop_match' "}

This behavior does not occur if I manually specify all vhbas (4 in my example code) in the ucs_san_connectivity task and do not use a loop.

Strangely enough, if I run the loop-based playbook first (which fails on item 2 as described above) and then the non-loop based playbook second (which when run on a clean environment works just fine), the non-loop playbook also fails with a similar message:

TASK [Create SAN Connectivity Policies] ****************************************
fatal: [ucspe-local]: FAILED! => {"changed": false, "msg": "setup error: 'NoneType' object has no attribute 'check_prop_match' "}

Running the non-loop playbook in a clean environment multiple times (first time creates the changes, subsequent runs produce 'ok's as expected) does not show that behavior.

As a reference point, I do this exact some setup with the LAN analog of this module - ucs_lan_connectivity - and do not have any issues at all with the loop.

@gve-vse-tim
Copy link
Author

All sample playbooks, how I got these outputs, etc. found here:
https://github.com/gve-vse-tim/ucsm-san-conn-bug

@rubenribeiro
Copy link

Having the same issue.

@rubenribeiro
Copy link

Resolved it by passing a list Instead of looping through a vhba_list

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