'Given the UUID of a provider, set the inventory records for the
provider to the supplied dict of resources.
:param rp_uuid: UUID of the resource provider to set inventory for
:param rp_name: Name of the resource provider in case we need to create
a record for it in the placement API
:param inv_data: Dict, keyed by resource class name, of inventory data
to set against the provider
:raises: exc.InvalidResourceClass if a supplied custom resource class
name does not meet the placement API\'s format requirements.'

def set_inventory_for_provider(self, rp_uuid, rp_name, inv_data):

    self._ensure_resource_provider(rp_uuid, rp_name)
    list(map(self._ensure_resource_class, (rc_name for rc_name in inv_data if (rc_name not in fields.ResourceClass.STANDARD))))
    if inv_data:
        self._update_inventory(rp_uuid, inv_data)
    else:
        self._delete_inventory(rp_uuid)
