Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from netmiko import ConnectHandler
- tplink_switch = {
- 'device_type': 'tplink_jetstream',
- 'host': '172.16.41.58',
- 'username': 'x',
- 'password': 'x',
- 'secret': 'x'
- }
- ch = ConnectHandler(**tplink_switch)
- ch.enable()
- Traceback (most recent call last):
- File "C:\Python3\Lib\code.py", line 90, in runcode
- exec(code, self.locals)
- File "<input>", line 1, in <module>
- File "D:\python\switch\Lib\site-packages\netmiko\ssh_dispatcher.py", line 365, in ConnectHandler
- return ConnectionClass(*args, **kwargs)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "D:\python\switch\Lib\site-packages\netmiko\tplink\tplink_jetstream.py", line 149, in __init__
- return super().__init__(**kwargs)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "D:\python\switch\Lib\site-packages\netmiko\tplink\tplink_jetstream.py", line 21, in __init__
- return super().__init__(**kwargs)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "D:\python\switch\Lib\site-packages\netmiko\base_connection.py", line 439, in __init__
- self._open()
- File "D:\python\switch\Lib\site-packages\netmiko\base_connection.py", line 445, in _open
- self._try_session_preparation()
- File "D:\python\switch\Lib\site-packages\netmiko\base_connection.py", line 904, in _try_session_preparation
- self.session_preparation()
- File "D:\python\switch\Lib\site-packages\netmiko\tplink\tplink_jetstream.py", line 30, in session_preparation
- self._test_channel_read(pattern=r"[>#]")
- File "D:\python\switch\Lib\site-packages\netmiko\base_connection.py", line 1144, in _test_channel_read
- return self.read_until_pattern(pattern=pattern, read_timeout=20)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "D:\python\switch\Lib\site-packages\netmiko\base_connection.py", line 672, in read_until_pattern
- raise ReadTimeout(msg)
- netmiko.exceptions.ReadTimeout:
- Pattern not detected: '[>#]' in output.
- Things you might try to fix this:
- 1. Adjust the regex pattern to better identify the terminating string. Note, in
- many situations the pattern is automatically based on the network device's prompt.
- 2. Increase the read_timeout to a larger value.
- You can also look at the Netmiko session_log or debug log for more information.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement