Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@Pack3tL0ss

Description

@Pack3tL0ss
Issue body actions

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.

alagouttetchiapuziowong

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.