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

Pyro4.naming exception in get_my_ip #1771

Closed
darindf opened this issue Dec 8, 2017 · 0 comments
Closed

Pyro4.naming exception in get_my_ip #1771

darindf opened this issue Dec 8, 2017 · 0 comments

Comments

@darindf
Copy link
Contributor

darindf commented Dec 8, 2017

On a multi home nic computer, get_my_ip() is failing to use socket connection to nameserver to retrieve the external ip address to use. The code is proceeding to the default case to use hostname and to look up by ip address, which is currently resolving to virtualbox ethernet adapter that is not reachable from the dispatcher.

Specifically, the line
ns = Pyro4.naming.locateNS()
is throwing exception
module 'Pyro4' has no attribute 'naming'

when using Pyro4 version 4.62, thus get_my_ip() is defaulting to use
result = socket.gethostbyname(socket.gethostname())

The solution is to add
import Pyro4.naming

@menshikh-iv menshikh-iv changed the title Pyro4.naming excpetion Pyro4.naming exception in get_my_ip Dec 11, 2017
menshikh-iv pushed a commit that referenced this issue Dec 11, 2017
* fix 1771

* fix import
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