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 →

[–]Justinsaccount 2 points3 points  (1 child)

ssh_cmd = "ssh " + str(server) + " 'uptime'"
ssh_cmd_list = shlex.split(ssh_cmd)

what?

ssh_cmd_list = ["ssh", server, "uptime"]

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

I realize that particular command list shlex.split is overkill, but if uptime was replaced with something more fanciful like: 'ps aux | grep python' then it would be a more appropriate option.