mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	returned to successful login
This commit is contained in:
		| @@ -413,63 +413,6 @@ def main(): | ||||
|                   exit(1) | ||||
|  | ||||
|                if i == 0: | ||||
|                   logg.info("9800 found Escape character is '^] i:{} before: {} after: {}".format(i,egg.before,egg.after)) | ||||
|                   #egg.sendline(CR) | ||||
|                   found_escape = True | ||||
|                   sleep(0.4) | ||||
|  | ||||
|                if i == 1: | ||||
|                   logg.info("9800 found WLC>  will elevate loging i:{} before {} after {}".format(i,egg.before,egg.after)) | ||||
|                   egg.sendline("en") | ||||
|                   sleep(0.1) | ||||
|                   j = egg.expect_exact(["Password:",pexpect.TIMEOUT], timeout=2) | ||||
|                   if j == 0: | ||||
|                      logg.info("9800 received password prompt will send password: {} i:{} j:{} before {} after {}".format(args.passwd,i,j,egg.before,egg.after)) | ||||
|                      egg.sendline(args.passwd) | ||||
|                      sleep(0.1) | ||||
|                   if j == 1: | ||||
|                      logg.info("9800 received timeout after looking for password after sending user i:{} j:{} before {} after {}".format(i,j,egg.before,egg.after)) | ||||
|                 | ||||
|                if i == 2: | ||||
|                   logg.info("9800 found WLC#  i:{} before {} after {}".format(i,egg.before,egg.after)) | ||||
|                   logged_in_9800 = True | ||||
|                   sleep(0.4) | ||||
|  | ||||
|                if i == 3: | ||||
|                   logg.info("9800 found User will put in args.user {} i:{}  before {} after {}".format(args.user,i,egg.before,egg.after)) | ||||
|                   egg.sendline(args.user) | ||||
|                   sleep(0.4) | ||||
|  | ||||
|                if i == 4: | ||||
|                   logg.info("9800 received password prompt will send password: {}   i:{}  before {} after {}".format(args.passwd,i, egg.before,egg.after)) | ||||
|                   egg.sendline(args.passwd) | ||||
|                   sleep(0.4) | ||||
|  | ||||
|                if i == 5: | ||||
|                   logg.info("9800 received WLC(config)# prompt doing some cleanup") | ||||
|                   egg.sendline("end") | ||||
|                   sleep(0.4) | ||||
|  | ||||
|                if i == 7 or i == 6: | ||||
|                   logg.info("9800 Timed out waiting for initial prompt send logout loop_count: {} i: {} before {} after {}".format(loop_count, i, egg.before,egg.after)) | ||||
|                   logg.info("9800  Closing the connection and try to re-establish, ") | ||||
|                   egg.close(force = True) | ||||
|                   sleep(0.4) | ||||
|                   #egg.close(force = True) | ||||
|                   #sleep(0.2) | ||||
|  | ||||
|                   # re establish telnet | ||||
|                   cmd = "telnet %s %d"%(host, port) | ||||
|                   logg.info("Spawn: "+cmd+NL) | ||||
|                   egg = pexpect.spawn(cmd) | ||||
|                   egg.logfile = FileAdapter(logg) | ||||
|                   time.sleep(2) | ||||
|                   logged_in_9800 = False | ||||
|                   found_escape = False | ||||
|  | ||||
|  | ||||
| #####################################                | ||||
|                '''if i == 0: | ||||
|                   logg.info("9800 found Escape character is '^] i:{} before: {} after: {}".format(i,egg.before,egg.after)) | ||||
|                   #egg.sendline(CR) | ||||
|                   found_escape = True | ||||
| @@ -682,7 +625,7 @@ def main(): | ||||
|                   egg.logfile = FileAdapter(logg) | ||||
|                   time.sleep(2) | ||||
|                   logged_in_9800 = False | ||||
|                   found_escape = False''' | ||||
|                   found_escape = False | ||||
|  | ||||
|             if loop_count >= 6: | ||||
|                if found_escape == True: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chuck SmileyRekiere
					Chuck SmileyRekiere