High-level ssh client library
There is no common ssh client library. Different projects use own functions, or ssh function from processutils, which is not flexible enough.
Paramiko is not the answer, because it too low-level. For example:
import paramiko
ssh = paramiko.
ssh.set_
ssh.connect(
ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_
print ssh_stdout.read()
print ssh_stderr.read()
In example above, if there is data on stderr which do not fit in buffer then we got deadlock on stdout reading.
If we want to receive stdout, stderr and exit status, we should write even more code.
Working with this library may look like this:
ssh = sshclient.
status, stdout, stderr = ssh.execute('ps ax')
Execute command with huge output:
ssh = sshclient.
def stdout_
ssh.run('tail -f /var/log/syslog', stdout_
Execute local script on remote side:
ssh = sshclient.
status, out, err = ssh.execute(
Potential library consumers:
ironic
quantum
savanna
tempest
heat
cinder uses own advanced ssh library
nova uses command line ssh
Blueprint information
- Status:
- Started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Sergey Skripnick
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Discussion
- Series goal:
- None
- Implementation:
- Good progress
- Milestone target:
- None
- Started by
- Sergey Skripnick
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Why not just use paramiko? --jogo
Paramiko is too low level. A bunch of code needed for simply get stdout from command. --sergey
Can you add more details to this BP to clarify what you mean -- jogo
Done. --sergey
Why not fix paramiko? -- lifeless
It is not a bug in paramiko, paramiko just low level. -- sergey
I have to agree with lifeless. Have you asked the Paramiko maintainers if they would be willing to accept a patch for a higher-level API such as this? -- dhellmann
Addressed by: https:/
High level ssh library
Gerrit topic: https:/
Consider using Spur.py library (http://
spur looks like another reasonable candidate. I've removed this from the icehouse-2 series until we agree on the approach. Sergey, please start a mailing list thread evaluating the alternatives (it's really a pain to communicate through the whiteboard on the blueprint :-). - dhellmann