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()
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()]