'Update information about a host from a ComputeNode object.'

def _update_from_compute_node(self, compute):

    if (('free_disk_gb' not in compute) or (compute.free_disk_gb is None)):
        LOG.debug('Ignoring    compute    node    %s    as    its    usage    has    not    been    updated    yet.', compute.uuid)
        return
    self.vcpus_total = compute.vcpus
    self.vcpus_used = compute.vcpus_used
    self.free_ram_mb = compute.free_ram_mb
    self.total_usable_ram_mb = compute.memory_mb
    self.free_disk_mb = (compute.free_disk_gb * 1024)
    self.stats = (compute.stats or {})
    self.uuid = compute.uuid
    self.total_usable_disk_gb = compute.local_gb
    self.hypervisor_type = compute.hypervisor_type
    self.hypervisor_version = compute.hypervisor_version
    self.hypervisor_hostname = compute.hypervisor_hostname
    self.cpu_info = compute.cpu_info
    if compute.supported_hv_specs:
        self.supported_instances = [spec.to_list() for spec in compute.supported_hv_specs]
    else:
        self.supported_instances = []
    self.cpu_allocation_ratio = compute.cpu_allocation_ratio
    self.ram_allocation_ratio = compute.ram_allocation_ratio
    self.disk_allocation_ratio = compute.disk_allocation_ratio
    self.updated = compute.updated_at
