#NEWLINE# def get_bgpvpn( self , context , id , fields = None ) : #NEWLINE# #INDENT# LOG . debug ( ( 'get_bgpvpn called for id %s with fields = %s' % ( id , fields ) ) ) #NEWLINE# oc_client = self . _get_opencontrail_api_client ( context ) #NEWLINE# try : #NEWLINE# #INDENT# bgpvpn = json . loads ( oc_client . kv_store ( 'RETRIEVE' , key = id ) ) #NEWLINE# #UNINDENT# except ( oc_exc . OpenContrailAPINotFound , ValueError ) : #NEWLINE# #INDENT# raise bgpvpn . BGPVPNNotFound ( id = id ) #NEWLINE# #UNINDENT# if ( ( not isinstance ( bgpvpn , dict ) ) or ( 'bgpvpn' not in bgpvpn ) ) : #NEWLINE# #INDENT# raise bgpvpn . BGPVPNNotFound ( id = id ) #NEWLINE# #UNINDENT# bgpvpn = bgpvpn [ 'bgpvpn' ] #NEWLINE# if ( ( not fields ) or ( 'networks' in fields ) ) : #NEWLINE# #INDENT# bgpvpn [ 'networks' ] = [ net_assoc [ 'network_id' ] for net_assoc in self . get_net_assocs ( context , id ) ] #NEWLINE# #UNINDENT# return utils . make_bgpvpn_dict ( bgpvpn , fields )