def update_vlan_binding(netid, newvlanid=None, newvlanname=None):
 LOG.debug(_('update_vlan_binding() called'))
 session = db.get_session()
 try:
  binding = session.query(l2network_models.VlanBinding).filter_by(network_id=netid).one()
  if newvlanid:
   binding['vlan_id'] = newvlanid
  if newvlanname:
   binding['vlan_name'] = newvlanname
  session.merge(binding)
  session.flush()
  return binding
 except exc.NoResultFound:
  raise q_exc.NetworkNotFound(net_id=netid)

def update_vlan_binding ( netid , newvlanid = None , newvlanname = None ) : LOG . debug ( _ ( 'update_vlan_binding() called' ) ) session = db . get_session ( ) try : binding = session . query ( l2network_models . VlanBinding ) . filter_by ( network_id = netid ) . one ( ) if newvlanid : binding [ 'vlan_id' ] = newvlanid if newvlanname : binding [ 'vlan_name' ] = newvlanname session . merge ( binding ) session . flush ( ) return binding except exc . NoResultFound : raise q_exc . NetworkNotFound ( net_id = netid )
updates a vlan to network association .