Question

I'd like to use paramiko to run a command and exit when a pattern appears. Now I do it using pexpect.expect(..., pattern = [pattern1, pattern2,...])

Is there a way to do using paramiko?

Was it helpful?

Solution

No, I don't think paramiko has that capability. In my experience the best approach is to send the pexpect script to the remote and execute it there with your paramiko. Fabric users run into this issue sometimes: https://stackoverflow.com/a/10007635/708221

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top