mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 04:07:52 +00:00
Add another expect pattern to catch when we loose connection.
This commit is contained in:
@@ -166,6 +166,7 @@ def main():
|
|||||||
EXITPROMPT = "Would you like to save them now\? \(y/N\)"
|
EXITPROMPT = "Would you like to save them now\? \(y/N\)"
|
||||||
AREYOUSURE = "Are you sure you want to continue\? \(y/n\)"
|
AREYOUSURE = "Are you sure you want to continue\? \(y/n\)"
|
||||||
CLOSEDBYREMOTE = "closed by remote host."
|
CLOSEDBYREMOTE = "closed by remote host."
|
||||||
|
CLOSEDCX = "Connection to .* closed."
|
||||||
egg.expect(CCPROMPT)
|
egg.expect(CCPROMPT)
|
||||||
|
|
||||||
logg.info("Ap[%s] Action[%s] Value[%s] "%(args.ap, args.action, args.value))
|
logg.info("Ap[%s] Action[%s] Value[%s] "%(args.ap, args.action, args.value))
|
||||||
@@ -228,7 +229,7 @@ def main():
|
|||||||
egg.sendline("y")
|
egg.sendline("y")
|
||||||
|
|
||||||
egg.sendline("logout")
|
egg.sendline("logout")
|
||||||
i = egg.expect([EXITPROMPT, CLOSEDBYREMOTE])
|
i = egg.expect([EXITPROMPT, CLOSEDBYREMOTE, CLOSEDCX])
|
||||||
if i == 0:
|
if i == 0:
|
||||||
egg.sendline("y")
|
egg.sendline("y")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user