Beispiel #1
0
 def test_add_non_external_gateway_network(self):
     self.nsxv_driver._validate_gateway_network = (bgp_driver.NSXvBgpDriver(
         self.bgp_plugin)._validate_gateway_network)
     with self.gw_network(external=False) as net,\
         self.subnetpool_with_address_scope(4,
                                            prefixes=['8.0.0.0/8']) as sp:
         network_id = net['network']['id']
         with self.bgp_speaker(sp['ip_version'], 1234) as speaker:
             self.assertRaises(exc.NsxBgpNetworkNotExternal,
                               self.bgp_plugin.add_gateway_network,
                               self.context, speaker['id'],
                               {'network_id': network_id})
Beispiel #2
0
    def __init__(self):
        super(NSXBgpPlugin, self).__init__()
        self._core_plugin = directory.get_plugin()

        # initialize the supported drivers (currently only NSX-v)
        self.drivers = {}
        try:
            self.drivers[projectpluginmap.NsxPlugins.NSX_V] = (
                nsxv_driver.NSXvBgpDriver(self))
        except Exception:
            # No driver found
            LOG.warning("NSXBgpPlugin failed to initialize the NSX-V driver")
            self.drivers[projectpluginmap.NsxPlugins.NSX_V] = None

        self._register_callbacks()
Beispiel #3
0
 def __init__(self):
     super(NSXvBgpPlugin, self).__init__()
     self.nsxv_driver = nsxv_driver.NSXvBgpDriver(self)
     self._register_callbacks()