SeattleTestbed / seash

Interactive vessel management tool
MIT License
0 stars 10 forks source link

geoip lookup via "show location" is broken #81

Closed aaaaalbert closed 9 years ago

aaaaalbert commented 9 years ago

@yyzhuang reports that the version of seash shipped with Sensibility Testbed (i.e. not the one in the current production demokit) fails trying to look up the locations of vessels:

yanyan@browsegood !> show location
%1(192.36.94.3): Location unknown

Raising the exception (rather than silencing it so as to print "Location unknown") in https://github.com/SeattleTestbed/seash/blob/master/modules/geoip/__init__.py#L52 , we learn that

yanyan@browsegood !> show location

Traceback (most recent call last):

 File "seash.py", line 261, in command_loop

 File "/Users/yyzh/sensibility_demokit/seash_dictionary.py", line 2109, in
command_dispatch

 File "/Users/yyzh/sensibility_demokit/modules/geoip/__init__.py", line
47, in show_location

NameError: global name 'gethostbyname' is not defined

The obvious fix, changing https://github.com/SeattleTestbed/seash/blob/master/modules/geoip/__init__.py#L18 to from repyportability import * and thus make the gethostbyname call available does not fix the problem: Then, httpretrieve.r2py causes a TimeoutError in the geoip_client.r2py library. The httpretrieve problem is currently under investigation in https://github.com/aaaaalbert/seattlelib_v2/tree/fix-httpretrieve .


Task: Try the (presumably) fixed version of httpretrieve with the fix to modules/geoip/__init__.py described above, and see what happens.