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, nb_api):
        super(BGPService, self).__init__()
        self.initialize_driver()
        self.db_store = db_store2.get_instance()

        self.nb_api = nb_api

        self.bgp_pulse = loopingcall.FixedIntervalLoopingCall(
            self.sync_data_from_nb_db)
示例#3
0
 def __init__(self,
              api,
              db_store=None,
              vswitch_api=None,
              nb_api=None,
              neutron_server_notifier=None):
     self.api = api
     self.db_store = db_store
     self.db_store2 = db_store2.get_instance()
     self.vswitch_api = vswitch_api
     self.nb_api = nb_api
     self.neutron_server_notifier = neutron_server_notifier
     # Though there is nothing to initialize in super class, call it
     # will make the multi-inheritence work.
     super(DFlowApp, self).__init__()
     self._register_events()
示例#4
0
    def __init__(self, controller, enable_selective_topology_distribution):
        self.ovs_port_type = (constants.OVS_VM_INTERFACE,
                              constants.OVS_TUNNEL_INTERFACE,
                              constants.OVS_PATCH_INTERFACE)

        # Stores topics(tenants) subscribed by lports in the current local
        # controller. I,e, {tenant1:{lport1, lport2}, tenant2:{lport3}}
        self.topic_subscribed = {}
        self.enable_selective_topo_dist = \
            enable_selective_topology_distribution
        self.ovs_ports = {}
        self.ovs_to_lport_mapping = {}

        self.controller = controller
        self.nb_api = controller.get_nb_api()
        self.db_store = controller.get_db_store()
        self.openflow_app = controller.get_openflow_app()
        self.chassis_name = controller.get_chassis_name()
        self.db_store2 = db_store2.get_instance()

        ovs.OvsPort.register_updated(self.ovs_port_updated)
        ovs.OvsPort.register_deleted(self.ovs_port_deleted)
示例#5
0
 def _fetch_obj(self):
     # _model attribute is provided by the deriving class
     obj = db_store2.get_instance().get_one(self._model(id=self._id))
     # FIXME fetch from NbApi
     return obj