'Creates or updates stats for the supplied compute node.
:param compute_node: updated nova.objects.ComputeNode to report
:raises `exception.InventoryInUse` if the compute node has had changes
to its inventory but there are still active allocations for
resource classes that would be deleted by an update to the
placement API.'

def update_compute_node(self, compute_node):

    self._ensure_resource_provider(compute_node.uuid, compute_node.hypervisor_hostname)
    inv_data = _compute_node_to_inventory_dict(compute_node)
    if inv_data:
        self._update_inventory(compute_node.uuid, inv_data)
    else:
        self._delete_inventory(compute_node.uuid)
