Skip to content

Commit

Permalink
Black fromatting (telekom#4)
Browse files Browse the repository at this point in the history
* update telnet.py

* update telnet.py

* update ssh.py

* update telnet.py

* update telnet.py

* update telnet.py

* update telnet.py

* update telnet.py

* match for initial command as well

* define cli patterns centrally

* comment

* black

---------
  • Loading branch information
phoenixszg authored Jun 22, 2023
1 parent 3b140d3 commit d290b6c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mb_netmgmt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,19 @@ def get_proxy(self, stub):

def get_cli_patterns(self):
patterns = []
patterns.append(b"[\r\n\x1b\[K][\-\w+\.:/]+(?:\([^\)]+\))?[>#] ?$") # based on IOS driver of Exscript
patterns.append(b"[\r\n\x00\x1b\[K]RP/\d+/(?:RS?P)?\d+\/CPU\d+:[^#]+(?:\([^\)]+\))?#$") # based on IOS XR driver of Exscript
patterns.append(b"[\r\n\x00\x1b\[K](?P<text>[\w/ .:,\(\)\-\?]*)(?P<default>\[[\w/.:\-]*\])?(?(default)(?P<end1>(?:\?|: ?|)$)|(?P<end2>: $))") # Interactive prompt
patterns.append(
b"[\r\n\x1b\[K][\-\w+\.:/]+(?:\([^\)]+\))?[>#] ?$"
) # based on IOS driver of Exscript
patterns.append(
b"[\r\n\x00\x1b\[K]RP/\d+/(?:RS?P)?\d+\/CPU\d+:[^#]+(?:\([^\)]+\))?#$"
) # based on IOS XR driver of Exscript
patterns.append(
b"[\r\n\x00\x1b\[K](?P<text>[\w/ .:,\(\)\-\?]*)(?P<default>\[[\w/.:\-]*\])?(?(default)(?P<end1>(?:\?|: ?|)$)|(?P<end2>: $))"
) # Interactive prompt
patterns.append(b"[\r\n\x00\x1b\[K] --More-- $") # Terminal paging
return patterns


def disable_algorithms(disabled_algorithms):
# https://github.com/ncclient/ncclient/issues/526#issuecomment-1096563028
class MonkeyPatchedTransport(paramiko.Transport):
Expand Down

0 comments on commit d290b6c

Please sign in to comment.