@db_api.api_context_manager.writer
def _delete_inventory(context, rp, resource_class):
 _ensure_rc_cache(context)
 conn = context.session.connection()
 rc_id = _RC_CACHE.id_from_string(resource_class)
 with conn.begin():
  if (not _delete_inventory_from_provider(conn, rp, [rc_id])):
   raise exception.NotFound(('No inventory of class %s found for delete' % resource_class))
  rp.generation = _increment_provider_generation(conn, rp)

@ db_api . api_context_manager . writer def _delete_inventory ( context , rp , resource_class ) : _ensure_rc_cache ( context ) conn = context . session . connection ( ) rc_id = _RC_CACHE . id_from_string ( resource_class ) with conn . begin ( ) : if ( not _delete_inventory_from_provider ( conn , rp , [ rc_id ] ) ) : raise exception . NotFound ( ( 'No inventory of class %s found for delete' % resource_class ) ) rp . generation = _increment_provider_generation ( conn , rp )
delete up to one inventory of the given resource_class string .