def _update_ip(address, method): """Call this function when you learn about a new external IP address""" global _externalIP if not Twisted.is_local_ip(address): if not _externalIP: pass elif _externalIP != address: log_msg( "%s reported a different external IP than we already knew about: %s vs %s" % (method, Basic.clean(address), Basic.clean(_externalIP)), 3, ) else: return _externalIP = address GlobalEvents.throw_event("ip_update", address, method) else: log_msg("Learned about local address %s via %s, not very helpful..." % (Basic.clean(address), method), 4)
def _update_ip(address, method): """Call this function when you learn about a new external IP address""" global _externalIP if not Twisted.is_local_ip(address): if not _externalIP: pass elif _externalIP != address: log_msg( "%s reported a different external IP than we already knew about: %s vs %s" % (method, Basic.clean(address), Basic.clean(_externalIP)), 3) else: return _externalIP = address GlobalEvents.throw_event("ip_update", address, method) else: log_msg( "Learned about local address %s via %s, not very helpful..." % (Basic.clean(address), method), 4)