

def _to_node(self, domain):
    (state, max_mem, memory, vcpu_count, used_cpu_time) = domain.info()
    state = self.NODE_STATE_MAP.get(state, NodeState.UNKNOWN)
    (public_ips, private_ips) = ([], [])
    ip_addresses = self._get_ip_addresses_for_domain(domain)
    for ip_address in ip_addresses:
        if is_public_subnet(ip_address):
            public_ips.append(ip_address)
        else:
            private_ips.append(ip_address)
    extra = {
        'uuid': domain.UUIDString(),
        'os_type': domain.OSType(),
        'types': self.connection.getType(),
        'used_memory': (memory / 1024),
        'vcpu_count': vcpu_count,
        'used_cpu_time': used_cpu_time,
    }
    node = Node(id=domain.ID(), name=domain.name(), state=state, public_ips=public_ips, private_ips=private_ips, driver=self, extra=extra)
    node._uuid = domain.UUIDString()
    return node

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/libvirt_driver.py LibvirtNodeDriver._to_node/original