def add_qos(tenant_id, qos_name, qos_desc):
 LOG.debug(_('add_qos() called'))
 session = db.get_session()
 try:
  qos = session.query(network_models_v2.QoS).filter_by(tenant_id=tenant_id).filter_by(qos_name=qos_name).one()
  raise c_exc.QosNameAlreadyExists(qos_name=qos_name, tenant_id=tenant_id)
 except exc.NoResultFound:
  qos = network_models_v2.QoS(tenant_id, qos_name, qos_desc)
  session.add(qos)
  session.flush()
  return qos

def add_qos ( tenant_id , qos_name , qos_desc ) : LOG . debug ( _ ( 'add_qos() called' ) ) session = db . get_session ( ) try : qos = session . query ( network_models_v2 . QoS ) . filter_by ( tenant_id = tenant_id ) . filter_by ( qos_name = qos_name ) . one ( ) raise c_exc . QosNameAlreadyExists ( qos_name = qos_name , tenant_id = tenant_id ) except exc . NoResultFound : qos = network_models_v2 . QoS ( tenant_id , qos_name , qos_desc ) session . add ( qos ) session . flush ( ) return qos
adds a qos to tenant association .