chopsticks
chopsticks copied to clipboard
can not call simple commands
The first example with calling time works perfectly. But when I try to do other simple things such as:
print(ssh.call(sys.version_info))
then the following exception is raised:
_pickle.PicklingError: Can't pickle <class 'sys.version_info'>: it's not the same object as sys.version_info
Also when getting a bit more complex:
print(ssh.call(subprocess.check_output, "apt-get update", shell=True).raise_failures())
Traceback (most recent call last):
File "sticks.py", line 23, in <module>
print(ssh.call(subprocess.check_output, "apt-get update", shell=True).raise_failures())
File "/Users/konstruktor/.local/share/virtualenvs/shipit-WRCZ5US3/lib/python3.6/site-packages/chopsticks/tunnel.py", line 291, in call
raise RemoteException(ret.msg)
I'm tunneling into a Ubuntu 18.04 machine. With SSHTunnel.
You have to redirect stdout stdout=sys.stderr
otherwise the output of the command will break the protocol.