Skip to content

Commit 2f17a6a

Browse files
authored
Merge pull request #3709 from ktbyers/fix_reflags_enable
Fix missing flags in re.search call in enable()
2 parents 7d01387 + 37f22d7 commit 2f17a6a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

netmiko/adtran/adtran.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def enable(
5050
)
5151

5252
# Send the "secret" in response to password pattern
53-
if re.search(pattern, output):
53+
if re.search(pattern, output, flags=re_flags):
5454
self.write_channel(self.normalize_cmd(self.secret))
5555

5656
# Handle the fallback to local authentication case

netmiko/base_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ def enable(
20552055
)
20562056

20572057
# Send the "secret" in response to password pattern
2058-
if re.search(pattern, output):
2058+
if re.search(pattern, output, flags=re_flags):
20592059
self.write_channel(self.normalize_cmd(self.secret))
20602060
output += self.read_until_prompt()
20612061

netmiko/tplink/tplink_jetstream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def enable(
7474
pattern=pattern, re_flags=re_flags, read_entire_line=True
7575
)
7676
output += new_data
77-
if re.search(pattern, new_data):
77+
if re.search(pattern, new_data, flags=re_flags):
7878
self.write_channel(self.normalize_cmd(self.secret))
7979
output += self.read_until_prompt(read_entire_line=True)
8080
except ReadTimeout:

0 commit comments

Comments
 (0)