def is_ip_configured(_ip): ips = Network().get_all_configured_ips() for ip, eth_name in ips.iteritems(): ip, mask = str(ip).split("/") if ip == _ip: return True return False
def __clean_unused_ips(self): ips = Network().get_all_configured_ips() for ip, eth_name in ips.iteritems(): ip, netmask = str(ip).split("/") if ip not in self.__local_ips and ip != self.__node_info.backend_1_ip and \ ip != self.__node_info.backend_2_ip and ip != self.__node_info.management_ip: NetworkAPI().delete_ip(ip, eth_name, netmask) logger.debug("Clean unused ip {} on interface {}.".format( ip, eth_name))