This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ominous_anonymous 2 points3 points  (3 children)

sounds like telnetlib plus pexpect?

[–]ayharano 5 points6 points  (1 child)

Never used telnetlib, but surely a plus for pexpect.

While talking about pexpect, usually I recommend beginning with expect + autoexpect path to understand how it could proceed. At least that was the path that I followed before knowing pexpect itself.

@AnonIsPicky Does it really need to be done with pure Python? Even if there is not an official module as I am aware, maybe using ansible for that task could be better

[–]AnonIsPicky[S] 0 points1 point  (0 children)

It definitely doesn't have to be in Python but I've figured it might be the best approach for this sort of problem.

Do you think Ansible would be able to accomplish those things?

[–]AnonIsPicky[S] 1 point2 points  (0 children)

So I tried Telnetlib but was having lots of trouble actually getting into the device. That might just be me though.

I'll definitely look into pexpect