def device_has_ip(self, ip):
        try:
            device_addresses = netifaces.ifaddresses(self.device_name)
        except __HOLE__:  # The device does not exist on the system
            return False

        try:
            addresses = [ip_addr['addr'] for ip_addr in
                         device_addresses.get(netifaces.AF_INET, [])]
            return ip in addresses
        except OSError:
            LOG.error(_LE("Failed to get ip addresses for interface: %s."),
                self.device_name)
            return False
dataset/ETHPy150Open openstack/neutron/neutron/agent/windows/ip_lib.py/IPDevice.device_has_ip