Since Keymile NOS always returns True on paramiko.connect() we check the output for substring Login incorrect after connecting.
(self, count: int = 40, pattern: str = "")
| 15 | self.clear_buffer() |
| 16 | |
| 17 | def _test_channel_read(self, count: int = 40, pattern: str = "") -> str: |
| 18 | """Since Keymile NOS always returns True on paramiko.connect() we |
| 19 | check the output for substring Login incorrect after connecting.""" |
| 20 | output = super()._test_channel_read(count=count, pattern=pattern) |
| 21 | pattern = r"Login incorrect" |
| 22 | if re.search(pattern, output): |
| 23 | self.paramiko_cleanup() |
| 24 | msg = "Authentication failure: unable to connect" |
| 25 | msg += f"{self.device_type} {self.host}:{self.port}" |
| 26 | msg += self.RESPONSE_RETURN + "Login incorrect" |
| 27 | raise NetmikoAuthenticationException(msg) |
| 28 | else: |
| 29 | return output |
| 30 | |
| 31 | def special_login_handler(self, delay_factor: float = 1.0) -> None: |
| 32 | """Since Keymile NOS always returns True on paramiko.connect() we |
no test coverage detected