Cope with the Netgear switch not asking about saving changes
At disconnect, it may ask or not. Cope either way - deal with
pexpect.EOF() and exit cleanly if needed.
Change-Id: I7fe7a8c807ace00cfb7bfc108a9d4b1bfd7ebcde
diff --git a/drivers/NetgearXSM.py b/drivers/NetgearXSM.py
index de12eaf..1281cbc 100644
--- a/drivers/NetgearXSM.py
+++ b/drivers/NetgearXSM.py
@@ -527,8 +527,11 @@
def _logout(self):
logging.debug("Logging out")
self._cli("quit", False)
- self.connection.expect("Would you like to save them now")
- self._cli("n")
+ try:
+ self.connection.expect("Would you like to save them now")
+ self._cli("n")
+ except (pexpect.EOF):
+ pass
def _configure(self):
self._cli("configure")