'Return a dict, keyed by resource class, of inventory information for
the supplied node.'

def get_inventory(self, nodename):

    node = self._node_from_cache(nodename)
    info = self._node_resource(node)
    if (info['vcpus'] == 0):
        return {}
    result = {obj_fields.ResourceClass.VCPU: {'total': info['vcpus'], 'reserved': 0, 'min_unit': 1, 'max_unit': info['vcpus'], 'step_size': 1, 'allocation_ratio': 1.0}, obj_fields.ResourceClass.MEMORY_MB: {'total': info['memory_mb'], 'reserved': 0, 'min_unit': 1, 'max_unit': info['memory_mb'], 'step_size': 1, 'allocation_ratio': 1.0}, obj_fields.ResourceClass.DISK_GB: {'total': info['local_gb'], 'reserved': 0, 'min_unit': 1, 'max_unit': info['local_gb'], 'step_size': 1, 'allocation_ratio': 1.0}}
    rc_name = info.get('resource_class')
    if (rc_name is not None):
        norm_name = obj_fields.ResourceClass.normalize_name(rc_name)
        if (norm_name is not None):
            result[norm_name] = {'total': 1, 'reserved': 0, 'min_unit': 1, 'max_unit': 1, 'step_size': 1, 'allocation_ratio': 1.0}
    return result
