From 6c531202824cf0bf923338ff17b36fa99f592d19 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 30 Sep 2020 11:54:08 -0600 Subject: [PATCH] trying to catch the lockup with cisco controller and graceful exit --- cisco_wifi_ctl.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index ff0fc170..80cbf252 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -588,13 +588,24 @@ def main(): logg.info("9800 Timed out waiting for initial prompt send logout i: {} before {} after {}".format(i, egg.before,egg.after)) egg.sendline(CR) sleep(0.2) - + r = 0 + while( r <= 120): + egg.expect(pexpect.TIMEOUT,timeout=0) + logg.info("Not seeing prompts r {} before {} after {}".format(r,egg.before,egg.after)) + egg.sendline("Hello?") + sleep(1) loop_count += 1 if loop_count >= 3: if found_escape == True: logg.info("9800 there may be another prompt present that not aware of") logg.info("9800 will send escape to close telnet") + r = 0 + while( r <= 120): + egg.expect(pexpect.TIMEOUT,timeout=0) + logg.info("Not seeing prompts r {} before {} after {}".format(r,egg.before,egg.after)) + egg.sendline("Hello?") + sleep(1) egg.sendline("\x1b\r") logg.info("9800 the excape was found... close egg session") egg.close(force = True)