'The get_inventory() virt driver method is only implemented for some
virt drivers. This method returns inventory information for a
node/provider in a way that the placement API better understands, and
if this method doesn\'t raise a NotImplementedError, this triggers
_update() to call the set_inventory_for_provider() method of the
reporting client instead of the update_compute_node() method.'

@mock.patch('nova.compute.resource_tracker._normalize_inventory_from_cn_obj')
@mock.patch('nova.objects.ComputeNode.save')
def test_existing_node_get_inventory_implemented(self, save_mock, norm_mock):

    self._setup_rt()
    self.driver_mock.get_inventory.side_effect = [mock.sentinel.inv_data]
    orig_compute = _COMPUTE_NODE_FIXTURES[0].obj_clone()
    self.rt.compute_nodes[_NODENAME] = orig_compute
    self.rt.old_resources[_NODENAME] = orig_compute
    new_compute = orig_compute.obj_clone()
    new_compute.local_gb = 210000
    ucn_mock = self.sched_client_mock.update_compute_node
    sifp_mock = self.sched_client_mock.set_inventory_for_provider
    self.rt._update(mock.sentinel.ctx, new_compute)
    save_mock.assert_called_once_with()
    sifp_mock.assert_called_once_with(new_compute.uuid, new_compute.hypervisor_hostname, mock.sentinel.inv_data)
    self.assertFalse(ucn_mock.called)
