

def create_net_assoc_postcommit(self, context, net_assoc):
    bgpvpn = self.get_bgpvpn(context, net_assoc['bgpvpn_id'])
    url = ((BGPVPNS + '/') + bgpvpn['id'])
    self._scrub_rd_list(bgpvpn)
    try:
        self.client.sendjson('put', url, {
            BGPVPNS[:(- 1)]: bgpvpn,
        })
    except requests.exceptions.RequestException:
        with excutils.save_and_reraise_exception():
            d_netassoc = self.bgpvpn_db.delete_net_assoc(context, net_assoc['id'], net_assoc['bgpvpn_id'])
            LOG.debug('Deleted net_assoc %s from db', d_netassoc)

dataset/ETHPy150Open openstack/networking-bgpvpn/networking_bgpvpn/neutron/services/service_drivers/opendaylight/odl.py OpenDaylightBgpvpnDriver.create_net_assoc_postcommit/original