Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Read remote output and respond using paramiko (SSH.execute)
- ExpectedString = 'ExpectedOutput'
- Output = SSH.execute('./runScript')
- if Output == ExpectedString:
- SSH.execute('Enter this')
- else:
- raise SomeException
- ssh.connect('127.0.0.1', username='foo', password='bar')
- stdin, stdout, stderr = ssh.exec_command("some_script")
- stdin.write('expected_inputn')
- stdin.flush()
- data = stdout.read.splitlines()
Add Comment
Please, Sign In to add comment