def __init__(self, chassis_name, nb_api): self.db_store = db_store.DbStore() self.db_store2 = db_store2.get_instance() self.chassis_name = chassis_name self.nb_api = nb_api self.ip = cfg.CONF.df.local_ip # Virtual tunnel port support multiple tunnel types together self.tunnel_types = cfg.CONF.df.tunnel_types self.sync_finished = False self.vswitch_api = vswitch_impl.OvsApi(cfg.CONF.df.management_ip) self.neutron_notifier = None if cfg.CONF.df.enable_neutron_notifier: self.neutron_notifier = df_utils.load_driver( cfg.CONF.df.neutron_notifier, df_utils.DF_NEUTRON_NOTIFIER_DRIVER_NAMESPACE) app_mgr = app_manager.AppManager.get_instance() self.open_flow_app = app_mgr.instantiate( ryu_base_app.RyuDFAdapter, nb_api=self.nb_api, vswitch_api=self.vswitch_api, db_store=self.db_store, neutron_server_notifier=self.neutron_notifier, ) self.topology = None self.db_consistency_manager = None self.enable_db_consistency = cfg.CONF.df.enable_df_db_consistency self.enable_selective_topo_dist = \ cfg.CONF.df.enable_selective_topology_distribution
def __init__(self, chassis_name): self.next_network_id = 0 self.db_store = db_store.DbStore() self.chassis_name = chassis_name self.ip = cfg.CONF.df.local_ip self.tunnel_type = cfg.CONF.df.tunnel_type self.sync_finished = False self.port_status_notifier = None nb_driver = df_utils.load_driver(cfg.CONF.df.nb_db_class, df_utils.DF_NB_DB_DRIVER_NAMESPACE) self.nb_api = api_nb.NbApi(nb_driver, use_pubsub=cfg.CONF.df.enable_df_pub_sub) self.vswitch_api = vswitch_impl.OvsApi(self.ip) if cfg.CONF.df.enable_port_status_notifier: self.port_status_notifier = df_utils.load_driver( cfg.CONF.df.port_status_notifier, df_utils.DF_PORT_STATUS_DRIVER_NAMESPACE) kwargs = dict(nb_api=self.nb_api, vswitch_api=self.vswitch_api, db_store=self.db_store) app_mgr = app_manager.AppManager.get_instance() self.open_flow_app = app_mgr.instantiate(ryu_base_app.RyuDFAdapter, **kwargs) self.topology = None self.enable_selective_topo_dist = \ cfg.CONF.df.enable_selective_topology_distribution self.integration_bridge = cfg.CONF.df.integration_bridge
def __init__(self, chassis_name): self.next_network_id = 0 self.db_store = db_store.DbStore() self.nb_api = None self.vswitch_api = None self.chassis_name = chassis_name self.ip = cfg.CONF.df.local_ip self.tunnel_type = cfg.CONF.df.tunnel_type self.sync_finished = False kwargs = dict(db_store=self.db_store) self.dispatcher = dispatcher.AppDispatcher('dragonflow.controller', cfg.CONF.df.apps_list, kwargs)
def test_integration_stale_model_db_store(self): db_store_inst = db_store.DbStore() with mock.patch('dragonflow.db.db_store.get_instance', return_value=db_store_inst): model_test1 = ModelTest(id='1', topic='topic') db_store_inst.update(model_test1) reffing_model = RefferingModel(id='2', model_test='1') self.assertEqual(model_test1, reffing_model.model_test.get_object()) model_test2 = ModelTest(id='1', topic='topic2') db_store_inst.update(model_test2) self.assertEqual(model_test2, reffing_model.model_test.get_object())
def __init__(self, chassis_name): self.next_network_id = 0 self.db_store = db_store.DbStore() self.chassis_name = chassis_name self.ip = cfg.CONF.df.local_ip self.tunnel_type = cfg.CONF.df.tunnel_type self.sync_finished = False nb_driver_class = importutils.import_class(cfg.CONF.df.nb_db_class) self.nb_api = api_nb.NbApi(nb_driver_class(), use_pubsub=cfg.CONF.df.enable_df_pub_sub) self.vswitch_api = ovsdb_vswitch_impl.OvsdbSwitchApi( self.ip, self.nb_api) kwargs = dict(nb_api=self.nb_api, vswitch_api=self.vswitch_api, db_store=self.db_store) app_mgr = AppManager.get_instance() self.open_flow_app = app_mgr.instantiate(RyuDFAdapter, **kwargs) self.topology = None self.enable_selective_topo_dist = \ cfg.CONF.df.enable_selective_topology_distribution
def setUp(self): super(TestDbStore, self).setUp() # Skip singleton instance to have clean state for each test self.db_store = db_store.DbStore()
def setUp(self): tests_base.BaseTestCase.setUp(self) self.db_store = db_store.DbStore()