Anyone has an idea or hint on this #python problem?
I want to read a log from a device using telnetlib. I send "show log" and then get a reply, but if it's longer than 22 lines, the device waits for the user to press return before displaying the rest. I don't know an "expected" string to use with read_until, nor do I know how long the reply will be.
Any help would be appreciated :)
@dennix sounds like you're going to be stuck with hacky workarounds, unless "show log" accepts flags to say "please don't page the output" or the like.
i've not used telnetlib, but if you can accept it taking a while, you could use either read_until or expect and look for the device's prompt. if it times out, send whichever key the device uses to fetch another page, and call read_until/expect again.
@dennix if it's not a huge pain on the device, that'll probably turn out to be much easier on the python side. requests is your friend here.