Пример #1
0
    def connect(switch):
        # connect to the switch, and log in:
        console = pexpect.spawn('telnet ' + switch.hostname)
        console.expect('User Name:')
        console.sendline(switch.username)
        console.expect('Password:'******'Logged in to switch %r', switch)

        prompts = _console.get_prompts(console)
        return _Session(switch=switch, console=console, **prompts)
Пример #2
0
    def connect(switch):
        console = pexpect.spawn('telnet ' + switch.hostname)
        console.expect('login: '******'Password: ')
        console.sendline(switch.password)

        prompts = _console.get_prompts(console)

        return _Session(console=console,
                        dummy_vlan=switch.dummy_vlan,
                        switch=switch,
                        **prompts)
Пример #3
0
    def connect(switch):
        # connect to the switch, and log in:
        console = pexpect.spawn('telnet ' + switch.hostname)
        console.expect('User Name:')
        console.sendline(switch.username)
        console.expect('Password:'******'Logged in to switch %r', switch)


        prompts = _console.get_prompts(console)
        return _Session(switch=switch,
                        console=console,
                        **prompts)
Пример #4
0
Файл: nexus.py Проект: henn/hil
    def connect(switch):
        console = pexpect.spawn("telnet " + switch.hostname)
        console.expect("login: "******"Password: "******"telnet " + switch.hostname)
        console.expect("login: "******"Password: ")
        console.sendline(switch.password)

        prompts = _console.get_prompts(console)

        return _Session(console=console, dummy_vlan=switch.dummy_vlan, switch=switch, **prompts)