Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zmq.ssh.tunnel.openssh_tunnel does not fail when it should #1178

Open
mristin opened this issue May 23, 2018 · 1 comment
Open

zmq.ssh.tunnel.openssh_tunnel does not fail when it should #1178

mristin opened this issue May 23, 2018 · 1 comment

Comments

@mristin
Copy link

mristin commented May 23, 2018

Hi!

I noticed that zmq.ssh.tunnel.openssh_tunnel does not fail when it should. If I just call:

import time

import zmq
import zmq.ssh

ctx = zmq.Context()
publisher = ctx.socket(zmq.PUB)

ssh_tunnel_pid = zmq.ssh.tunnel_connection(
    socket=publisher,
    addr="tcp://127.0.0.7:43777",
    server="localhostA", # mind the typo
    password=None,
    keyfile=None)

time.sleep(10)

there will be no error. However, on line 230 in zmq/ssh/tunnel.py:

tunnel = pexpect.spawn(cmd, env=env)

, the value of cmd is: ssh -f -S none -L 127.0.0.1:47209:127.0.0.7:43777 localhostA sleep 60

If I execute this command in my bash, I get: ssh: Could not resolve hostname localhosta: Name or service not known

Before I dive deeper and get myself familiar with pexpect to try to fix the bug (and submit a patch), could you give me any pointers what might cause this problem? Is this maybe expected behavior?

Thank you very much for your time!

@mristin
Copy link
Author

mristin commented Aug 3, 2018

Hi!
Any chance you could give me some pointers on this? Should I submit a pull request and make sure the expected behavior is to raise an error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant