示例#1
0
文件: demo.py 项目: esnet/enos
def workaround():
    # if this is the first time the demo is loaded, re-initialize the controller
    global firstTime

    if firstTime:
        cont = Controller.getInstance()
        cont.reinit()
        firstTime = False
        cleandemomodules()
示例#2
0
def workaround():
    # if this is the first time the demo is loaded, re-initialize the controller
    global firstTime

    if firstTime:
        cont = Controller.getInstance()
        cont.reinit()
        firstTime = False
        cleandemomodules()
示例#3
0
    def __init__(self, topology):
        """
        Note: topology might not be ready at this moment,
        so you are not allowed to access anything related to topology.builder here.
        However, you could do it later in method init(self).
        :param topology: TestbedTopology whose builder is not ready yet
        """
        self.__class__ = SimpleController
        SimpleController.__init__(self)
        self.__class__ = ODLClient

        self.odlController = Controller.getInstance()
        self.odlMdsalImpl = self.odlController.getOdlMdsalImpl()
        self.odlCorsaImpl = self.odlController.getOdlCorsaImpl()

        ODLClient.topology = topology
        self.debug = 0
        self.dropLLDP = True
        self.odlSwitchIndex = {} # [key=dpid]
        self.switchIndex = {} # [key=odlNode.getID()]