def update_qos(tenant_id, qos_id, new_qos_name=None):
 session = db.get_session()
 try:
  qos = session.query(l2network_models.QoS).filter_by(tenant_id=tenant_id).filter_by(qos_id=qos_id).one()
  if new_qos_name:
   qos['qos_name'] = new_qos_name
  session.merge(qos)
  session.flush()
  return qos
 except exc.NoResultFound:
  raise c_exc.QosNotFound(qos_id=qos_id, tenant_id=tenant_id)

def update_qos ( tenant_id , qos_id , new_qos_name = None ) : session = db . get_session ( ) try : qos = session . query ( l2network_models . QoS ) . filter_by ( tenant_id = tenant_id ) . filter_by ( qos_id = qos_id ) . one ( ) if new_qos_name : qos [ 'qos_name' ] = new_qos_name session . merge ( qos ) session . flush ( ) return qos except exc . NoResultFound : raise c_exc . QosNotFound ( qos_id = qos_id , tenant_id = tenant_id )
updates a qos to tenant association .