def update_nexusport_binding(port_id, new_vlan_id):
 LOG.debug(_('update_nexusport_binding called'))
 session = db.get_session()
 try:
  binding = session.query(nexus_models_v2.NexusPortBinding).filter_by(port_id=port_id).one()
  if new_vlan_id:
   binding['vlan_id'] = new_vlan_id
  session.merge(binding)
  session.flush()
  return binding
 except exc.NoResultFound:
  raise c_exc.NexusPortBindingNotFound()

def update_nexusport_binding ( port_id , new_vlan_id ) : LOG . debug ( _ ( 'update_nexusport_binding called' ) ) session = db . get_session ( ) try : binding = session . query ( nexus_models_v2 . NexusPortBinding ) . filter_by ( port_id = port_id ) . one ( ) if new_vlan_id : binding [ 'vlan_id' ] = new_vlan_id session . merge ( binding ) session . flush ( ) return binding except exc . NoResultFound : raise c_exc . NexusPortBindingNotFound ( )
updates nexusport binding .