-
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
Add buffer clean in Huawei session preparation #3131
base: develop
Are you sure you want to change the base?
Add buffer clean in Huawei session preparation #3131
Conversation
@k-ribot Why is this needed? Do you have more details? I would have thought it was unnecessary and slows things down. |
@ktbyers We use Netmiko to connect to equipment from our tool. This tool can be used at the same time by several users. When we have more than 4 connections at the same time on a Huawei. the prompt of the last connection is wrong because it uses the result of the command "screen-length 0 temporary". This is why the delay is necessary. Error received on the command "display version" executed after the connection:
|
Can you show what the CLI looks like when you see this message?
i.e. the message You can probably capture this via the Netmiko session_log and just include the session_log. I am reluctant to add the buffer clearing in the Thanks, Kirk |
81f93a4
to
48659fc
Compare
@k-ribot Are you still working on this? I still don't see why this is needed and am pretty reluctant to just add slowness without an understanding of why it is needed. |
Sorry we work on many projet, I forgot to send you the log file. I execute this python code: import logging
from typing import List
from netmiko import ConnectHandler
from threading import Thread
logging.basicConfig(filename='netmiko_global.log', level=logging.DEBUG)
logger = logging.getLogger("netmiko")
def test(i: int):
netmiko_connection = ConnectHandler(
host='...',
port=22,
username='...',
password='...',
device_type='huawei_vrp'
)
netmiko_connection.send_command('display version')
threads: List[Thread] = []
for i in range(0, 4):
threads.append(Thread(target=test, args=(i,)))
for thread in threads:
thread.start() I create 4 connection and I try to execute one command. Lines 466 and 670 we can read this: Without sleep before buffer clearing 2 threads find bad prompt and client raise ReadTimeout exception. |
48659fc
to
a891ebe
Compare
a891ebe
to
237a475
Compare
Hi @ktbyers I don't know if read my feedbacks. |
@k-ribot Not sure I understood your last statement there? |
No description provided.