connectors/PYRO/__init__.py
changeset 1035 0f905e027d18
parent 969 1950fe687dde
child 1070 86ee833e33ef
equal deleted inserted replaced
1034:078bf153fb8c 1035:0f905e027d18
    43     if location.find(service_type) != -1:
    43     if location.find(service_type) != -1:
    44         try :
    44         try :
    45             from util.Zeroconf import Zeroconf
    45             from util.Zeroconf import Zeroconf
    46             r = Zeroconf()
    46             r = Zeroconf()
    47             i=r.getServiceInfo(service_type, location)
    47             i=r.getServiceInfo(service_type, location)
       
    48             if i is None : raise Exception, "'%s' not found"%location
    48             ip = str(socket.inet_ntoa(i.getAddress()))
    49             ip = str(socket.inet_ntoa(i.getAddress()))
    49             port = str(i.getPort())
    50             port = str(i.getPort())
    50             newlocation = ip+':'+port
    51             newlocation = ip+':'+port
    51             confnodesroot.logger.write(_("'%s' is located at %s\n")%(location, newlocation))
    52             confnodesroot.logger.write(_("'%s' is located at %s\n")%(location, newlocation))
    52             location = newlocation
    53             location = newlocation