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

aoscx_l3_interface fails on 6200 tries to fetch BGP details from sw that doesn't support BGP #16

Open
Pack3tL0ss opened this issue Jan 19, 2022 · 0 comments

Comments

@Pack3tL0ss
Copy link

Pack3tL0ss commented Jan 19, 2022

The 6200 doesn't support BGP,

swagger on the 6200 shows the BGP method:
https://<ip of 6200>/rest/v10.04/system/vrfs/default/bgp_routers

However it returns a 404
unknown attribute for VRF: bgp_routers

In ansible aoscx_l3_interface on a 6200 (or 6100 which would be an issue anyway as the 6100 does not support Routed only ports) will throw an error as it's not handling this response, which is valid given the devices don't support it.

Traceback (most recent call last):
  File "/home/wade/.ansible/tmp/ansible-local-24017e3clgz02/ansible-tmp-1642567562.535256-24022-51633859472383/AnsiballZ_aoscx_l3_interface.py", line 107, in <module>
    _ansiballz_main()
  File "/home/wade/.ansible/tmp/ansible-local-24017e3clgz02/ansible-tmp-1642567562.535256-24022-51633859472383/AnsiballZ_aoscx_l3_interface.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/wade/.ansible/tmp/ansible-local-24017e3clgz02/ansible-tmp-1642567562.535256-24022-51633859472383/AnsiballZ_aoscx_l3_interface.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_l3_interface', init_globals=dict(_module_fqn='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_l3_interface', _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_aoscx_l3_interface_payload__jl9wziz/ansible_aoscx_l3_interface_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_l3_interface.py", line 314, in <module>
  File "/tmp/ansible_aoscx_l3_interface_payload__jl9wziz/ansible_aoscx_l3_interface_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_l3_interface.py", line 217, in main
  File "/home/wade/.local/lib/python3.8/site-packages/pyaoscx/pyaoscx_module.py", line 48, in is_materialized
    return fnct(self, *args, **kwargs)
  File "/home/wade/.local/lib/python3.8/site-packages/pyaoscx/interface.py", line 1114, in configure_l3
    vrf_obj.get()
  File "/home/wade/.local/lib/python3.8/site-packages/pyaoscx/pyaoscx_module.py", line 33, in ensure_connected
    return fnct(self, *args, **kwargs)
  File "/home/wade/.local/lib/python3.8/site-packages/pyaoscx/vrf.py", line 159, in get
    BgpRouter.get_all(self.session, self)
  File "/home/wade/.local/lib/python3.8/site-packages/pyaoscx/bgp_router.py", line 197, in get_all
    raise GenericOperationError(response.text, response.status_code)
pyaoscx.exceptions.generic_op_error.GenericOperationError: GENERIC OPERATION ERROR: unknown attribute for VRF: bgp_routers
 Code: 404

From the looks of it we need to either handle the unknown attribute for VRF: bgp_routers and set to None or whatever we need to denote BGP is not configured, or ideally look at the model/capabilities of the switch and skip the API call entirely for the models that don't support it.

FYI: the 6200 supports Routed Only Ports, but only after setting system internal-vlan-range I expect the l3_interface module doesn't check for that today, as it's quirk specific to the 6200.

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

1 participant