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

Alcatel-Lucent Enterprise AOS8 integration #759

Open
wants to merge 86 commits into
base: develop
Choose a base branch
from

Conversation

jefvantongerloo
Copy link

@jefvantongerloo jefvantongerloo commented Jul 1, 2022

Description

Alcatel-Lucent Enterprise AOS8 (aos) support for the following services:

  • arpnd
  • device
  • interfaces
  • inventory
  • macs
  • routes
  • vlan

Type of change

  • New feature (non-breaking change which adds functionality)

Changes to the Documentation

Index.md and nos table.md updated.

Proposed Release Note Entry

Support for ALE AOS8: Added support for Alcatel-Lucent Enterprise AOS8 platform. All testing was done on both 8.6.x and 8.7.x releases. The support includes the following services: arpnd, device, interfaces, inventory, macs, routes and vlans. Contribution by @jefvantongerloo

Double-Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR source branch is created from the develop branch.
  • My PR targets the develop branch.
  • All my commits have --signoff applied

@jefvantongerloo jefvantongerloo marked this pull request as ready for review July 1, 2022 11:41
Copy link
Collaborator

@claudious96 claudious96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all thanks for the work!

I left some minor comments about styling or linting-related. You can see the reason in the github actions for flake8 and pylint, or just run locally pylint suzieq and flake8 suzieq.

Others are related to default values in the cleanup functions in services and about some missing fields for tables entries: arpnd, interfaces, routes.

Comment on lines 502 to 503
["show system",
"show version",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep show version as first command, we don't want to break anything that was previously supported. We would not support auto discovery for Alcatel-Lucent Enterprise for the moment, users could still specify the devtype in the inventory when running the poller.
@ddutt what's your view?

Copy link
Author

@jefvantongerloo jefvantongerloo Jul 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should be fixed with a durable solution.

There is a problem with the ´only_one´ parameters on the cmd execution in function ´_get_device_type_hostname´ for the device discovery. If an unknown command is sent to the device, status 0 and an error message in standard output get returned. So when the correct command for that type of device is not used first, the device gets discovered as unknown.

The program can also never enter the elif function because only one command from the list is sent if the return status is 0 (even with an error return):

        elif (len(output) > 1) and (output[1]["status"] == 0):
            devtype = 'unsupported'
            data = output[1]["data"]
            if data:
                if "Cumulus Linux" in data:
                    devtype = "cumulus"
                else:
                    devtype = "linux"

                version_str = data
                # Hostname is the last line of the output
                if len(data.strip()) > 0:
                    hostname = data.splitlines()[-1].strip()

Sample terminal output on unknown cli command (with return status code 0):

net-swi-001> show version
                     ^
ERROR: Invalid entry: "version"

Ansible netcommon library plugins have a similar issue fixed with regex search patterns to match the error output. For cases where the return code is 0, but the command is unknown for the nos.

    terminal_stderr_re = [
        re.compile(rb"[\r\n]ERROR:\s*.*[\r\n]+", re.IGNORECASE),
    ]

Copy link
Collaborator

@claudious96 claudious96 Jul 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should be fixed with a durable solution.

I agree. What you propose, checking for a command failure using both the return code AND a regex for the output, seems the best way to go.

For this first phase I'd go for supporting Alcatel-Lucent only supplying devtype as aos in the inventory, we can implement the new way of determining a failed command separately and then come back to having the automatic discovery.

Sample terminal output on unknown cli command (with return status code 0):

net-swi-001> show version
^
ERROR: Invalid entry: "version"

Does this appear in the stdout or stderr?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminal output from cli command, so stdout.

suzieq/poller/worker/nodes/node.py Outdated Show resolved Hide resolved
suzieq/poller/worker/nodes/node.py Outdated Show resolved Hide resolved
suzieq/poller/worker/nodes/node.py Outdated Show resolved Hide resolved
suzieq/poller/worker/services/arpnd.py Outdated Show resolved Hide resolved
suzieq/poller/worker/services/macs.py Outdated Show resolved Hide resolved
suzieq/poller/worker/services/macs.py Outdated Show resolved Hide resolved
suzieq/poller/worker/services/routes.py Show resolved Hide resolved
suzieq/poller/worker/services/interfaces.py Outdated Show resolved Hide resolved
suzieq/poller/worker/services/arpnd.py Show resolved Hide resolved
claudiolor and others added 28 commits July 7, 2022 20:05
Signed-off-by: Claudio Lorina <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: Dinesh Dutt <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: Dinesh Dutt <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: Dinesh Dutt <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: Claudio Lorina <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: Dinesh Dutt <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: Dinesh Dutt <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
@jefvantongerloo
Copy link
Author

jefvantongerloo commented Dec 22, 2022

  • Updated and tested the textfsm templates in latest aos releases (8.9.73.R01 & 8.8.56.R02).
  • Added ip interfaces en aggregate interfaces.
  • Added ip and vlan members on route and interface services.
  • Added oif on router service.

jefvantongerloo and others added 18 commits December 22, 2022 15:28
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
The show version command should be the first one to be executed as IOS*
devices close the connection after the first command. While AOS returns
0 in case of an error. To solve this issue we try to match the response
  agaist a pattern to guess the return code of the command

Signed-off-by: Claudio Lorina <[email protected]>
Signed-off-by: Claudio Lorina <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
Signed-off-by: jefvantongerloo <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants