Exemple #1
0
 def create_net_assoc_precommit(self, context, net_assoc):
     bgpvpns = self.bgpvpn_db.find_bgpvpns_for_network(
         context, net_assoc['network_id'])
     if len(bgpvpns) > 1:
         raise bgpvpn_ext.BGPVPNNetworkAssocExistsAnotherBgpvpn(
             driver=OPENDAYLIGHT_BGPVPN_DRIVER_NAME,
             network=net_assoc['network_id'],
             bgpvpn=bgpvpns[0]['id'])
Exemple #2
0
 def create_net_assoc_precommit(self, context, net_assoc):
     our_bgpvpn = None
     bgpvpns = self.get_bgpvpns(context)
     for bgpvpn in bgpvpns:
         # ODL only allows a network to be associated with one BGPVPN
         if bgpvpn['id'] == net_assoc['bgpvpn_id']:
             our_bgpvpn = bgpvpn
         else:
             if bgpvpn['networks'] and (net_assoc['network_id']
                                        in bgpvpn['networks']):
                 raise bgpvpn_ext.BGPVPNNetworkAssocExistsAnotherBgpvpn(
                     driver="OpenDaylight V2",
                     network=net_assoc['network_id'],
                     bgpvpn=bgpvpn['id'])
     journal.record(context, odl_const.ODL_BGPVPN, our_bgpvpn['id'],
                    odl_const.ODL_UPDATE, our_bgpvpn)