connectors/PYRO/__init__.py
changeset 1830 e598d1acf354
parent 1826 91796f408540
child 1832 0f1081928d65
equal deleted inserted replaced
1829:a776ac02b079 1830:e598d1acf354
    82         Connection.clientPostConnectionCheck = None
    82         Connection.clientPostConnectionCheck = None
    83     else:
    83     else:
    84         schemename = "PYROLOC"
    84         schemename = "PYROLOC"
    85     if location.find(service_type) != -1:
    85     if location.find(service_type) != -1:
    86         try:
    86         try:
    87             from util.Zeroconf import Zeroconf
    87             from zeroconf import Zeroconf
    88             r = Zeroconf()
    88             r = Zeroconf()
    89             i = r.getServiceInfo(service_type, location)
    89             i = r.get_service_info(service_type, location)
    90             if i is None:
    90             if i is None:
    91                 raise Exception("'%s' not found" % location)
    91                 raise Exception("'%s' not found" % location)
    92             ip = str(socket.inet_ntoa(i.getAddress()))
    92             ip = str(socket.inet_ntoa(i.address))
    93             port = str(i.getPort())
    93             port = str(i.port)
    94             newlocation = ip + ':' + port
    94             newlocation = ip + ':' + port
    95             confnodesroot.logger.write(_("'{a1}' is located at {a2}\n").format(a1=location, a2=newlocation))
    95             confnodesroot.logger.write(_("'{a1}' is located at {a2}\n").format(a1=location, a2=newlocation))
    96             location = newlocation
    96             location = newlocation
    97             r.close()
    97             r.close()
    98         except Exception, msg:
    98         except Exception, msg: