aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/CiscoSX300.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/CiscoSX300.py b/drivers/CiscoSX300.py
index 14947a2..03e24bb 100644
--- a/drivers/CiscoSX300.py
+++ b/drivers/CiscoSX300.py
@@ -324,14 +324,18 @@ class CiscoSX300(SwitchDriver):
self._cli("%s" % username)
self.connection.expect("Password:")
self._cli("%s" % password, False)
+ self.connection.expect("\*\*")
while True:
- index = self.connection.expect(['User Name:', 'authentication failed', r'(.*)#', '.*'])
+ index = self.connection.expect(['User Name:', 'authentication failed', r'(.*)#', 'Password:', '.+'])
if index == 0 or index == 1: # Failed to log in!
logging.error("Login failure: %s\n" % self.connection.match)
raise IOError
elif index == 2:
self._prompt_name = self.connection.match.group(1).strip()
+ logging.debug("Got prompt name %s" % self._prompt_name)
return 0
+ elif index == 3 or index == 4:
+ self._cli("", False)
def _logout(self):
logging.debug("Logging out")