Exemplo n.º 1
0
def register_app(app):
    assert isinstance(app, RyuApp)
    # print "SERVICE_BRICKS:", SERVICE_BRICKS

    assert app.name not in SERVICE_BRICKS
    SERVICE_BRICKS[app.name] = app
    register_instance(app)
Exemplo n.º 2
0
def register_app(app):
    assert isinstance(app, RyuApp)
    # print "SERVICE_BRICKS:", SERVICE_BRICKS

    assert app.name not in SERVICE_BRICKS
    SERVICE_BRICKS[app.name] = app
    register_instance(app)
Exemplo n.º 3
0
 def instantiate_apps(self, *args, **kwargs):
     for app_name, cls in self.applications_cls.items():
         # for now, only single instance of a given module
         # Do we need to support multiple instances?
         # Yes, maybe for slicing.
         LOG.info('instantiating app %s', app_name)
         assert app_name not in self.applications
         app = cls(*args, **kwargs)
         register_instance(app)
         self.applications[app_name] = app
Exemplo n.º 4
0
    def __init__(self, *args, **kwargs):
        super(Tester, self).__init__()
        self.ev_q = dispatcher.EventQueue(QUEUE_NAME_RUN_TEST_EV,
                                         RUN_TEST_EV_DISPATCHER)

        run_test_mod = utils.import_module(FLAGS.run_test_mod)
        LOG.debug('import run_test_mod.[%s]', run_test_mod.__name__)

        self.run_test = run_test_mod.RunTest(*args, **kwargs)
        handler.register_instance(self.run_test)
Exemplo n.º 5
0
 def instantiate_apps(self, *args, **kwargs):
     for app_name, cls in self.applications_cls.items():
         # for now, only single instance of a given module
         # Do we need to support multiple instances?
         # Yes, maybe for slicing.
         LOG.info('instantiating app %s', app_name)
         assert app_name not in self.applications
         app = cls(*args, **kwargs)
         register_instance(app)
         self.applications[app_name] = app
Exemplo n.º 6
0
    def __init__(self):
        super(DPSet, self).__init__()

        # dp registration and type setting can be occur in any order
        # Sometimes the sw_type is set before dp connection
        self.dp_types = {}

        self.dps = {}  # datapath_id => class Datapath
        self.ev_q = dispatcher.EventQueue(QUEUE_NAME_DPSET,
                                          DPSET_EV_DISPATCHER)
        handler.register_instance(self)
Exemplo n.º 7
0
Arquivo: dpset.py Projeto: ei23/ryu
    def __init__(self):
        super(DPSet, self).__init__()

        # dp registration and type setting can be occur in any order
        # Sometimes the sw_type is set before dp connection
        self.dp_types = {}

        self.dps = {}   # datapath_id => class Datapath
        self.ev_q = dispatcher.EventQueue(QUEUE_NAME_DPSET,
                                          DPSET_EV_DISPATCHER)
        handler.register_instance(self)
Exemplo n.º 8
0
    def load(self, app_mod_name, *args, **kwargs):
        # for now, only single instance of a given module
        # Do we need to support multiple instances?
        # Yes, maybe for slicing.
        assert app_mod_name not in self.applications

        cls = utils.import_object(app_mod_name)
        app = cls(*args, **kwargs)
        register_instance(app)

        self.applications[app_mod_name] = app
Exemplo n.º 9
0
    def load(self, app_mod_name, *args, **kwargs):
        # for now, only single instance of a given module
        # Do we need to support multiple instances?
        # Yes, maybe for slicing.
        assert app_mod_name not in self.applications

        cls = utils.import_object(app_mod_name)
        app = cls(*args, **kwargs)
        register_instance(app)

        self.applications[app_mod_name] = app
Exemplo n.º 10
0
def register_app(app):
    # print('app:',app)
    #('app:', <ryu.controller.ofp_handler.OFPHandler object at 0x7f457f769410>)
    assert isinstance(app, RyuApp)
    # print('isinstance(app,RyuApp):',isinstance(app,RyuApp))
    #('isinstance(app,RyuApp):', True)
    # print('app.name:',app.name)
    #('app.name:', 'ofp_event')
    # print('server_bricks:',SERVICE_BRICKS)
    #('server_bricks:', {})
    # assert app.name not in SERVICE_BRICKS
    # print('SERVICE_BRICKS:',SERVICE_BRICKS)
    SERVICE_BRICKS[app.name] = app
    # print('SERVICE_BRICKS:', SERVICE_BRICKS)
    #('SERVICE_BRICKS:', {'ofp_event': <ryu.controller.ofp_handler.OFPHandler object at 0x7f457f769410>})
    register_instance(app)
Exemplo n.º 11
0
    def instantiate_apps(self, *args, **kwargs):
        for app_name, cls in self.applications_cls.items():
            # for now, only single instance of a given module
            # Do we need to support multiple instances?
            # Yes, maybe for slicing.
            LOG.info('instantiating app %s', app_name)

            if 'OFP_VERSIONS' in cls.__dict__:
                for k in Datapath.supported_ofp_version.keys():
                    if not k in cls.OFP_VERSIONS:
                        del Datapath.supported_ofp_version[k]

            assert len(Datapath.supported_ofp_version), \
                'No OpenFlow version is available'

            assert app_name not in self.applications
            app = cls(*args, **kwargs)
            register_instance(app)
            self.applications[app_name] = app
Exemplo n.º 12
0
def register_app(app):
    assert isinstance(app, RyuApp)
    assert not app.name in SERVICE_BRICKS
    SERVICE_BRICKS[app.name] = app
    register_instance(app)
Exemplo n.º 13
0
def register_app(app):
    assert isinstance(app, RyuApp)
    assert not app.name in SERVICE_BRICKS
    SERVICE_BRICKS[app.name] = app
    register_instance(app)
Exemplo n.º 14
0
def register_app(app):
    assert isinstance(app, RyuApp)
    assert app.name not in SERVICE_BRICKS
    SERVICE_BRICKS[app.name] = app
    # 调用handler中的函数
    register_instance(app)
Exemplo n.º 15
0
def register_app(app):
    assert isinstance(app, RyuApp)
    assert app.name not in SERVICE_BRICKS
    LOG.info("app.name: %s", app.name)
    SERVICE_BRICKS[app.name] = app
    register_instance(app)