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_dvs_portgroup_find: Fix wrong var type while evaluating vlan and vlanlst #52

Closed
wants to merge 157 commits into from

Conversation

phsmith
Copy link
Contributor

@phsmith phsmith commented Mar 13, 2020

SUMMARY

Fix to the following error when the parameter vlanid is present on module invocation:

The full traceback is:
Traceback (most recent call last):
  File "/home/smith/.ansible/tmp/ansible-tmp-1584100538.3495727-273993929599900/AnsiballZ_vmware_dvs_portgroup_find.py", line 102, in <module>
    _ansiballz_main()
  File "/home/smith/.ansible/tmp/ansible-tmp-1584100538.3495727-273993929599900/AnsiballZ_vmware_dvs_portgroup_find.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/smith/.ansible/tmp/ansible-tmp-1584100538.3495727-273993929599900/AnsiballZ_vmware_dvs_portgroup_find.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_dvs_portgroup_find', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib64/python3.8/runpy.py", line 206, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.8/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib64/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py", line 214, in <module>
  File "/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py", line 210, in main
  File "/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py", line 174, in get_dvs_portgroup
  File "/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py", line 142, in vlan_match
TypeError: '<' not supported between instances of 'str' and 'int'

fatal: [localhost -> localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/smith/.ansible/tmp/ansible-tmp-1584100538.3495727-273993929599900/AnsiballZ_vmware_dvs_portgroup_find.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/smith/.ansible/tmp/ansible-tmp-1584100538.3495727-273993929599900/AnsiballZ_vmware_dvs_portgroup_find.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/smith/.ansible/tmp/ansible-tmp-1584100538.3495727-273993929599900/AnsiballZ_vmware_dvs_portgroup_find.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_dvs_portgroup_find', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.8/runpy.py\", line 206, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.8/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.8/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py\", line 214, in <module>\n  File \"/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py\", line 210, in main\n  File \"/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py\", line 174, in get_dvs_portgroup\n  File \"/tmp/ansible_community.vmware.vmware_dvs_portgroup_find_payload_xtqn5ai8/ansible_community.vmware.vmware_dvs_portgroup_find_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup_find.py\", line 142, in vlan_match\nTypeError: '<' not supported between instances of 'str' and 'int'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

vmware_dvs_portgroup_find

@phsmith phsmith changed the title Fix wrong var type while evaluating vlan and vlanlst vmware_dvs_portgroup_find: Fix wrong var type while evaluating vlan and vlanlst Mar 13, 2020
@goneri goneri changed the base branch from master to main July 6, 2020 14:39
@goneri
Copy link
Member

goneri commented Jul 6, 2020

Since 2020/07/06, the development branch of the community.vmware repository is called main, it was master before. We've adjusted your PR to track the new branch.

@goneri
Copy link
Member

goneri commented Jul 6, 2020

Hello @phsmith, thank you for the PR! Can you please just add a changelog fragment? https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#changelogs

@goneri
Copy link
Member

goneri commented Jul 6, 2020

It would also be great if you can extend the functional test to cover this problematical use-case, this way we won't reintroduce the issue inadvertently in the future. https://github.com/ansible-collections/vmware/blob/main/tests/integration/targets/vmware_dvs_portgroup_find/tasks/main.yml

@goneri goneri added the bug This issue/PR relates to a bug label Jul 6, 2020
@goneri goneri self-assigned this Jul 6, 2020
@phsmith
Copy link
Contributor Author

phsmith commented Jul 6, 2020

Hello @phsmith, thank you for the PR! Can you please just add a changelog fragment? https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#changelogs

Hello @goneri I'll do that right now.

@phsmith
Copy link
Contributor Author

phsmith commented Jul 6, 2020

It would also be great if you can extend the functional test to cover this problematical use-case, this way we won't reintroduce the issue inadvertently in the future. https://github.com/ansible-collections/vmware/blob/main/tests/integration/targets/vmware_dvs_portgroup_find/tasks/main.yml

Nice @goneri I'll try to do that.

Akasurde and others added 20 commits July 6, 2020 16:07
This patch reverts changes done in ansible-collections#45

Signed-off-by: Abhijeet Kasurde <[email protected]>
Akasurde and others added 27 commits July 6, 2020 17:52
…me_settings (ansible-collections#225)

VMware: Fix to be set default parameter for runtime_settings to runtime_settings

Reviewed-by: https://github.com/apps/ansible-zuul
…ter if you use VM name (ansible-collections#252)

vmware_guest_snapshot_info: document that folder is a required parameter if you use VM name

Reviewed-by: https://github.com/apps/ansible-zuul
@goneri
Copy link
Member

goneri commented Jul 7, 2020

It looks like the rebase went rogue :-). Since your patch is rather short, you may find easier to just cherry-pick the import lines and start a new branch/PR.

@phsmith
Copy link
Contributor Author

phsmith commented Jul 7, 2020

It looks like the rebase went rogue :-). Since your patch is rather short, you may find easier to just cherry-pick the import lines and start a new branch/PR.

You're right @goneri, I'll close this PR and open another one.
Thanks!

@phsmith phsmith closed this Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.