[Netdevicelib-checkins] CVS: netdevicelib/src/netdevicelib connections.py,1.9,1.10
Status: Alpha
Brought to you by:
bluecoat93
From: <net...@li...> - 2001-10-24 18:42:01
|
Update of /cvsroot/netdevicelib/netdevicelib/src/netdevicelib In directory usw-pr-cvs1:/tmp/cvs-serv19181 Modified Files: connections.py Log Message: - add the ability to pass the device type to the __main__ test code Index: connections.py =================================================================== RCS file: /cvsroot/netdevicelib/netdevicelib/src/netdevicelib/connections.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** connections.py 2001/10/04 18:12:33 1.9 --- connections.py 2001/10/24 18:41:58 1.10 *************** *** 141,145 **** result = self._conn.expect( matches, self._timeout ) ! self._debuglog( "Found username prompt" ) # Unless we only got a password prompt, send the username --- 141,149 ---- result = self._conn.expect( matches, self._timeout ) ! self._debuglog( "Found username prompt, match %s" % result[0] ) ! ! # If we didn't find a match, bail out ! if result[0] == -1: ! raise RuntimeError( "Didn't find a login prompt" ) # Unless we only got a password prompt, send the username *************** *** 286,296 **** # Make sure they entered all the parameters we need ! if len( args ) < 4: print "usage: connections.py " + \ ! "hostname username password [enable] command" sys.exit(1) # Create the connection object ! conn = ConnectionFactory().createConnection( "telnet", "IOS" ) # Set the debugging flag if the user indicated debugging --- 290,300 ---- # Make sure they entered all the parameters we need ! if len( args ) < 5: print "usage: connections.py " + \ ! "hostname type username password [enable] command" sys.exit(1) # Create the connection object ! conn = ConnectionFactory().createConnection( "telnet", args[1] ) # Set the debugging flag if the user indicated debugging *************** *** 300,311 **** # Open the connection and login conn.open( args[0] ) ! conn.login( args[1], args[2] ) # If the user provided an enable password, go into enable mode if len( args ) == 6: ! conn.enable( args[3] ) ! cmd = args[4] else: ! cmd = args[3] # Run the command and print the output --- 304,315 ---- # Open the connection and login conn.open( args[0] ) ! conn.login( args[2], args[3] ) # If the user provided an enable password, go into enable mode if len( args ) == 6: ! conn.enable( args[4] ) ! cmd = args[5] else: ! cmd = args[4] # Run the command and print the output |