def set_port_status(port_id, status):
 LOG.debug(_('set_port_status as %s called'), status)
 session = db.get_session()
 try:
  port = session.query(models_v2.Port).filter_by(id=port_id).one()
  port['status'] = status
  session.merge(port)
  session.flush()
 except exc.NoResultFound:
  raise q_exc.PortNotFound(port_id=port_id)

def set_port_status ( port_id , status ) : LOG . debug ( _ ( 'set_port_status as %s called' ) , status ) session = db . get_session ( ) try : port = session . query ( models_v2 . Port ) . filter_by ( id = port_id ) . one ( ) port [ 'status' ] = status session . merge ( port ) session . flush ( ) except exc . NoResultFound : raise q_exc . PortNotFound ( port_id = port_id )
set the port status .