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

nsxt_uplink_profiles module fails after initial run #490

Open
jdannenberg opened this issue Feb 27, 2024 · 0 comments
Open

nsxt_uplink_profiles module fails after initial run #490

jdannenberg opened this issue Feb 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jdannenberg
Copy link

Describe the bug

After initially configuring uplink_profiles the module fails with error: line 245, in check_for_update\nKeyError: 'uplinks'

full traceback:

The full traceback is:
Traceback (most recent call last):
File "/home/runner/.ansible/tmp/ansible-tmp-1709029311.7666762-10855-223110382414027/AnsiballZ_nsxt_uplink_profiles.py", line 107, in <module>
_ansiballz_main()
File "/home/runner/.ansible/tmp/ansible-tmp-1709029311.7666762-10855-223110382414027/AnsiballZ_nsxt_uplink_profiles.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/runner/.ansible/tmp/ansible-tmp-1709029311.7666762-10855-223110382414027/AnsiballZ_nsxt_uplink_profiles.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.vmware.ansible_for_nsxt.plugins.modules.nsxt_uplink_profiles', init_globals=dict(_module_fqn='ansible_collections.vmware.ansible_for_nsxt.plugins.modules.nsxt_uplink_profiles', _modlib_path=modlib_path),
File "/usr/lib64/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib64/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload_puinlc6c/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_uplink_profiles.py", line 360, in <module>
File "/tmp/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload_puinlc6c/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_uplink_profiles.py", line 308, in main
File "/tmp/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload_puinlc6c/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_uplink_profiles.py", line 245, in check_for_update
KeyError: 'uplinks'
failed: [blabla -> localhost] (item={'mtu': 9000, 'lags': [{'mode': 'ACTIVE', 'name': 'name-lag', 'timeout_type': 'FAST', 'number_of_uplinks': 2, 'load_balance_algorithm': 'SRCDESTIPVLAN'}], 'teaming': {'policy': 'LOADBALANCE_SRC_MAC', 'active_list': [{'uplink_name': 'name-lag', 'uplink_type': 'LAG'}]}, 'transport_vlan': 0}) => {
"ansible_loop_var": "profile",
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/home/runner/.ansible/tmp/ansible-tmp-1709029311.7666762-10855-223110382414027/AnsiballZ_nsxt_uplink_profiles.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/runner/.ansible/tmp/ansible-tmp-1709029311.7666762-10855-223110382414027/AnsiballZ_nsxt_uplink_profiles.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/runner/.ansible/tmp/ansible-tmp-1709029311.7666762-10855-223110382414027/AnsiballZ_nsxt_uplink_profiles.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.vmware.ansible_for_nsxt.plugins.modules.nsxt_uplink_profiles', init_globals=dict(_module_fqn='ansible_collections.vmware.ansible_for_nsxt.plugins.modules.nsxt_uplink_profiles', _modlib_path=modlib_path),\n File \"/usr/lib64/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload_puinlc6c/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_uplink_profiles.py\", line 360, in <module>\n File \"/tmp/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload_puinlc6c/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_uplink_profiles.py\", line 308, in main\n File \"/tmp/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload_puinlc6c/ansible_vmware.ansible_for_nsxt.nsxt_uplink_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_uplink_profiles.py\", line 245, in check_for_update\nKeyError: 'uplinks'\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"profile": {
"lags": [
{
"load_balance_algorithm": "SRCDESTIPVLAN",
"mode": "ACTIVE",
"name": "name-lag",
"number_of_uplinks": 2,
"timeout_type": "FAST"
}
],
"mtu": 9000,
"teaming": {
"active_list": [
{
"uplink_name": "name-lag",
"uplink_type": "LAG"
}
],
"policy": "LOADBALANCE_SRC_MAC"
},
"transport_vlan": 0
},
"rc": 1
}

Reproduction steps

  1. Run task which configures uplink profiles using module nsxt_uplink_profiles
  2. Run task again.

Expected behavior

nsxt_uplink_profiles can be run against configured system.

Additional context

The error says that the diff_obj has no 'uplinks' key. However, if I make an API request the results.lags.uplinks (as list) is definitely there.

@jdannenberg jdannenberg added the bug Something isn't working label Feb 27, 2024
jdannenberg added a commit to jdannenberg/ansible-for-nsxt that referenced this issue Feb 27, 2024
…fing uplink profile

Signed-off-by: Julian Dannenberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant