Esempio n. 1
0
    def launch(self, protocol, terminal_controller):
        self.last_connection_id += 1

        self.logger = logging.getLogger("fake_switches.arista.{}.{}.{}".format(
            self.switch_configuration.name, self.last_connection_id, protocol))

        processor = self.processor_stack(display_class=TerminalDisplay)

        processor.init(
            self.switch_configuration,
            LoggingTerminalController(self.logger, terminal_controller),
            self.logger, NotPipingProcessor())

        return AristaShellSession(processor)
Esempio n. 2
0
    def launch(self, protocol, terminal_controller):
        self.last_connection_id += 1
        self.logger = logging.getLogger("fake_switches.dell.%s.%s.%s" %
                                        (self.switch_configuration.name,
                                         self.last_connection_id, protocol))

        command_processor = DellDefaultCommandProcessor(
            switch_configuration=self.switch_configuration,
            terminal_controller=LoggingTerminalController(
                self.logger, terminal_controller),
            piping_processor=PipingProcessor(self.logger),
            logger=self.logger)

        return DellShellSession(command_processor)
Esempio n. 3
0
    def launch(self, protocol, terminal_controller):
        self.last_connection_id += 1

        self.logger = logging.getLogger("fake_switches.cisco.%s.%s.%s" %
                                        (self.switch_configuration.name,
                                         self.last_connection_id, protocol))

        processor = self.new_command_processor()
        if not self.switch_configuration.auto_enabled:
            processor = DefaultCommandProcessor(processor)

        processor.init(
            self.switch_configuration,
            LoggingTerminalController(self.logger, terminal_controller),
            self.logger, PipingProcessor(self.logger))
        return CiscoShellSession(processor)
Esempio n. 4
0
    def launch(self, protocol, terminal_controller):
        self.last_connection_id += 1
        self.logger = logging.getLogger("fake_switches.dell10g.%s.%s.%s" %
                                        (self.switch_configuration.name,
                                         self.last_connection_id, protocol))

        processor = Dell10GDefaultCommandProcessor(
            enabled=Dell10GEnabledCommandProcessor(
                config=Dell10GConfigCommandProcessor(
                    config_vlan=Dell10GConfigureVlanCommandProcessor(),
                    config_vrf=ConfigVrfCommandProcessor(),
                    config_interface=Dell10GConfigInterfaceCommandProcessor(
                    ))))
        processor.init(switch_configuration=self.switch_configuration,
                       terminal_controller=LoggingTerminalController(
                           self.logger, terminal_controller),
                       piping_processor=PipingProcessor(self.logger),
                       logger=self.logger)

        return DellShellSession(processor)
Esempio n. 5
0
    def launch(self, protocol, terminal_controller):
        self.last_connection_id += 1

        self.logger = logging.getLogger("fake_switches.brocade.%s.%s.%s" %
                                        (self.switch_configuration.name,
                                         self.last_connection_id, protocol))

        command_processor = DefaultCommandProcessor(
            enabled=EnabledCommandProcessor(config=ConfigCommandProcessor(
                config_vlan=ConfigVlanCommandProcessor(),
                config_vrf=ConfigVrfCommandProcessor(),
                config_interface=ConfigInterfaceCommandProcessor(),
                config_virtual_interface=ConfigVirtualInterfaceCommandProcessor(
                    config_virtual_interface_vrrp=
                    ConfigVirtualInterfaceVrrpCommandProcessor()))))
        command_processor.init(switch_configuration=self.switch_configuration,
                               terminal_controller=LoggingTerminalController(
                                   self.logger, terminal_controller),
                               piping_processor=PipingProcessor(self.logger),
                               logger=self.logger)

        return BrocadeShellSession(command_processor)