Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this example, the Mininet driver inherits from the abstract Emulator driver which inherits from the CLI driver. The Mininet driver reuses the execute and disconnect API from the CLI driver. The connect API is the only API that is redefined.

Code Block
class MininetMininetCliDriver(Emulator):

        def __init__(self):
            super(EmulatorMininetCliDriver, self).__init__()
            self.handle = self

        def connect(self,user_name, ip_address, pwd,options):
            self.handle = super(MininetMininetCliDriver, self).connect(user_name, ip_address, pwd)

Here the connect will call the super (clidriver) connectinherited connect() method from CLI driver (via Emulator class).

Driver specific methods/functions can be specified using the simple execute command inĀ mininetclidriver.

...