Users Guide

Table Of Contents
1734 Dell EMC Networking Python Support
import sys
HOST = '127.0.0.1'
PORT = 23
LOGIN_STRING = "Login:"
PASSWORD_STRING = "Password:"
TERMINAL_LEN_ZERO = "terminal length 0\n"
TERMINAL_MONITOR = "terminal monitor\n"
ENABLE_STRING = "enable\n"
CONFIG_STRING = "configure\n"
USERNAME = 'admin'
PASSWORD = 'password'
ENABLE_PASSWORD = ''
TIMEOUT = 3
def do_terminal_settings(tn):
tn.write(TERMINAL_MONITOR)
tn.read_until("#")
tn.write(TERMINAL_LEN_ZERO)
tn.read_until("#")
def do_login(tn):
print "TN object created\n"
tn.read_until(LOGIN_STRING, TIMEOUT)
print "Read Login Prompt\n"
tn.write(USERNAME + "\n")
tn.read_until(PASSWORD_STRING, TIMEOUT)
print "Read Password Prompt\n"
tn.write(PASSWORD + "\n")
tn.read_until(">", TIMEOUT)
print "Received Exec Prompt\n"
tn.write(ENABLE_STRING)
tn.read_until("#", TIMEOUT)
print "Received Enable Prompt\n"
def do_config(tn):
tn.write(CONFIG_STRING)
tn.read_until("#", TIMEOUT)
print "Received Config Prompt\n"
tn.write("ip routing\n");
print "Enabled ip routing\n"
tn.write("exit\n");
tn.read_until("#")