def getIpAddresses(self): """ List the IP addresses to which we can contact the service. @return: list of IP addresses @rtype: array of strings """ ips = [ ip for ip in self.ipaddresses \ if ip != '0.0.0.0' and ip != '127.0.0.1' and ip != '::1'] if not ips: ips = Service.getNonLoopbackIpAddresses(self) ips = [ x.split('/',1)[0] for x in ips ] return ips
def getIpAddresses(self): """ List the IP addresses to which we can contact the service. @return: list of IP addresses @rtype: array of strings """ ips = [ ip for ip in self.ipaddresses \ if ip != '0.0.0.0' and ip != '127.0.0.1' and ip != '::1'] if not ips: ips = Service.getNonLoopbackIpAddresses(self) ips = [x.split('/', 1)[0] for x in ips] return ips
def _getManageIp(self): """ Pick an IP out of available choices. @return: IP address to contact the service on @rtype: string """ manage_ip = Service.getManageIp(self) bare_ip = manage_ip.split('/',1)[0] if bare_ip in self.ipaddresses: return bare_ip for ip in self.ipaddresses: if ip != '0.0.0.0' and ip != '127.0.0.1' and ip != '::1': return ip return bare_ip