def _getNetworkIp(self, bridge): try: ip = netinfo.ifconfig()[bridge]['addr'] except: ip = config.get('addresses', 'guests_gateway_ip') if ip == '': ip = '0' self.log.info('network %s: using %s', bridge, ip) return ip
def _getServerIP(self, addr=None): """Return the IP address we should listen on""" if addr: return addr try: addr = netinfo.ifconfig()[self.defaultBridge]['addr'] except: pass return addr