diff options
author | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-02-12 03:09:17 +0000 |
---|---|---|
committer | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-02-12 03:09:17 +0000 |
commit | 2eececb0fcdd950298c95b67490146c264960dc3 (patch) | |
tree | 51fa931a9d0b773f9a7700cf2904534cbe3638e6 | |
parent | bbd2ac833981edc87b4b0bf8c8985004a96ed58d (diff) |
More debug for connection errors
Change-Id: I8d5ffe956789560c5bca85ffe45bea26318b3c86
-rw-r--r-- | drivers/CiscoSX300.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/CiscoSX300.py b/drivers/CiscoSX300.py index b68adf3..66212b5 100644 --- a/drivers/CiscoSX300.py +++ b/drivers/CiscoSX300.py @@ -349,6 +349,7 @@ class CiscoSX300(SwitchDriver): elif index == 2: self._prompt_name = self.connection.match.group(1).strip() logging.debug("Got prompt name %s" % self._prompt_name) + print "Got prompt name %s" % self._prompt_name return 0 elif index == 3 or index == 4: self._cli("", False) @@ -365,7 +366,11 @@ class CiscoSX300(SwitchDriver): def _read_long_output(self): prompt = self._prompt_name + '#' - self.connection.expect(prompt) + try: + self.connection.expect(prompt) + except: + print "prompt is \"%s\"" % prompt + raise buf = [] for line in self.connection.before.split('\r\n'): buf.append(line.strip()) |