Closed sirmax123 closed 3 months ago
Reproduced with
pip3 list | grep scrapli
scrapli 2024.1.30
guessing this is not really an iosxe device ya? if thats true then you need to either send the command without using the send_command
helper stuff (meaning you need to just write using the transport directly, like conn.transport.write) or you need to disable terminal width setting for your platform (or make it really big) like all the other platforms do. you can also try to set comms_roughly_match_inputs
-> true -- this thing basically just makes sure all the chars of your input are found in order in the echoed output from your device, in theory this means that when your device sends backspace ansi control chars (or whatever its doing) we should still successfully "read" your input back off the channel and be able to continue on.
@carlmontanari
Thank you for your reply,
guessing this is not really an iosxe device ya?
yes, this is ZTE C320 OLT (Pon network switch), not Cisco IOS-XE
like
conn.transport.write
yes, this works for me
I do not know how to see what device sends back, there are no colors in the telnet
session output, but it looks like it sends \n\r
instead of \n
, anyway my issue is solved
I understand that it is not possible to test scrapli with any no-name Chinese switch (or I'd better say "piece of shit" instead of "switch" about this device) so I think we can close the issue as a non-relevant to the scrapli.
The only question I have is: Is it possible to enable "deep logging" to see what was sent to the device and what was got back before parsing?
Thank you, Max
ah I forgot one thing, you can prolly also use this (passed as kwarg to your driver.send_command). its also worth testing that roughly match setting I mentioned the other day.
in general though if you want to use the transport.write you then are going to have to be fully managing the read loop yourself basically. so you can check out the channel package and see how things are look in there and replicate to your need -- basically you just need to also conn.transport.read in a loop until you have consumed what you wrote into the channel and also what the response from the device was and all the way up to the prompt.
I would bet that there is a way to set terminal width on your device though, so I would defo look into that more. I dont think ive seen a device that doesn't let ya set that but who knows!
re the logging q: logging at debug level logs all output right after we read it from the transport, so that should get you what you need I imagine.
anyway, good luck :D
Describe the bug Some long commands are failed to execute with
To Reproduce Steps to reproduce the behavior:
(actual cmd is:
mgmt-ip 10.99.32.1 255.255.255.0 vlan 99 priority 0 route 0.0.0.0 0.0.0.0 10.99.32.254 host 1
)Execution part:
Device configuration
Part of script output:
Expected behavior
Stack Trace
Screenshots If applicable, add screenshots to help explain your problem, but do note that formatted text is much preferred over screenshots!
OS (please complete the following information):