Exemplo n.º 1
0
Arquivo: API.py Projeto: ekohl/vdsm
 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
Exemplo n.º 2
0
    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