-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support for NEC Univerge IX Routers #3408
base: develop
Are you sure you want to change the base?
Conversation
I have fixed the Telnet bug by ignoring option negotiation to maintain the session. class NecIxTelnet(NecIxBase):
"""NecIx Telnet driver."""
def ignore_option_negotiation(self, sock, cmd, opt):
pass
def telnet_login(
self,
pri_prompt_terminator: str = r"#\s*$",
alt_prompt_terminator: str = r">\s*$",
username_pattern: str = r"login",
pwd_pattern: str = r"assword",
delay_factor: float = 1.0,
max_loops: int = 20,
) -> str:
self.remote_conn.set_option_negotiation_callback(self.ignore_option_negotiation)
return super().telnet_login(
pri_prompt_terminator = pri_prompt_terminator,
alt_prompt_terminator = alt_prompt_terminator,
username_pattern = username_pattern,
pwd_pattern = pwd_pattern,
delay_factor = delay_factor,
max_loops = max_loops
) Router debug log
I will conduct tests over the weekend and, if there are no issues, will submit the pull request again. |
@inaba-vdom-0 Okay, let me know when this pull-request is ready and I will review (or when a new version of it is ready). |
@ktbyers I have recently modified the code and committed the tested code. Please check the code. |
@ktbyers I fixed it to reference the internal telnetlib, but I'm still getting an error because there's an undefined type. |
I added support for the NEC Univerge IX Router series.
https://jpn.nec.com/univerge/ix/index.html
Test configuration:
test_devices.yml
commands.yml
responses.yml
nec_ix_commands.txt
I will send the test results, but there are some issues.
test_result.log
I also conducted tests for autodetection.
test-code-autodetect.py
test_result.log
test-code.log
Issues:
exit_config_mode
test_exit_config_mode in test_netmiko_config.py, an error occurs because check_config_mode returns True after exit_config_mode. Although the configure command is used to return to the top menu of the configure mode from the interface configure mode, the prompt usually remains the same. Using the exit command will exit the configure mode, limiting the available show commands. Therefore, it is necessary to use the configure command as much as possible.
example command logging
Telnet driver
There is a bug in the Telnet driver. When performing telnet access, login fails and returns a "telnet connection closed" error.
terminal log
When debugging with debug logs and breakpoints, it was found that the base_connection forcibly closes the session when executing output = self.read_channel(). Router debug logging reveals that the TELS.003: Disconnected client log is outputted at the timing of output = self.read_channel().
base_connection.py
netmiko_debug.log
Router debug log
These issues can be submitted as separate issues rather than as part of a pull request.
Thank you!