mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
cisco_wifi_ctl.py: 3504 telnet logout clean up
This commit is contained in:
@@ -1325,6 +1325,7 @@ def main():
|
|||||||
loop_count = 0
|
loop_count = 0
|
||||||
while command_sent == False and loop_count <= 6:
|
while command_sent == False and loop_count <= 6:
|
||||||
loop_count += 1
|
loop_count += 1
|
||||||
|
try:
|
||||||
i = egg.expect([CCPROMPT,LEGACY_PROMPT,AREYOUSURE,'--More-- or',pexpect.TIMEOUT],timeout=3)
|
i = egg.expect([CCPROMPT,LEGACY_PROMPT,AREYOUSURE,'--More-- or',pexpect.TIMEOUT],timeout=3)
|
||||||
print (egg.before.decode('utf-8', 'ignore'))
|
print (egg.before.decode('utf-8', 'ignore'))
|
||||||
if i == 0 or i == 1:
|
if i == 0 or i == 1:
|
||||||
@@ -1338,12 +1339,16 @@ def main():
|
|||||||
break
|
break
|
||||||
if i == 3:
|
if i == 3:
|
||||||
egg.sendline(NL)
|
egg.sendline(NL)
|
||||||
|
except:
|
||||||
|
logg.info("exception in logout loop")
|
||||||
|
try:
|
||||||
egg.sendline("logout")
|
egg.sendline("logout")
|
||||||
logg.info("logout")
|
logg.info("logout")
|
||||||
i = egg.expect([LOGOUTPROMPT, EXITPROMPT, CLOSEDBYREMOTE, CLOSEDCX,pexpect.TIMEOUT],timeout=3)
|
i = egg.expect([LOGOUTPROMPT, EXITPROMPT, CLOSEDBYREMOTE, CLOSEDCX,pexpect.TIMEOUT],timeout=3)
|
||||||
if i == 1:
|
if i == 1:
|
||||||
egg.sendline("y")
|
egg.sendline("y")
|
||||||
|
except:
|
||||||
|
logg.info("exception is logout")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user