Skip to content

Commit d0f127a

Browse files
authored
Merge pull request #3688 from evilmonkey19/huawei_smartax_speedtest_enable_config
Speeding up Enable and Config in `huawei smartax`
2 parents 8dc3ba4 + a10aa42 commit d0f127a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

netmiko/huawei/huawei_smartax.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,26 @@ def disable_paging(
8888
)
8989

9090
def config_mode(
91-
self, config_command: str = "config", pattern: str = "", re_flags: int = 0
91+
self, config_command: str = "config", pattern: str = r"\)#", re_flags: int = 0
9292
) -> str:
9393
return super().config_mode(
9494
config_command=config_command, pattern=pattern, re_flags=re_flags
9595
)
9696

9797
def check_config_mode(
98-
self, check_string: str = ")#", pattern: str = "", force_regex: bool = False
98+
self,
99+
check_string: str = "\\)#",
100+
pattern: str = "[#>]",
101+
force_regex: bool = True,
99102
) -> bool:
100-
return super().check_config_mode(check_string=check_string)
103+
return super().check_config_mode(
104+
check_string=check_string, pattern=pattern, force_regex=force_regex
105+
)
101106

102107
def exit_config_mode(
103108
self, exit_config: str = "return", pattern: str = r"#.*"
104109
) -> str:
105-
return super().exit_config_mode(exit_config=exit_config)
110+
return super().exit_config_mode(exit_config=exit_config, pattern=pattern)
106111

107112
def check_enable_mode(self, check_string: str = "#") -> bool:
108113
return super().check_enable_mode(check_string=check_string)

0 commit comments

Comments
 (0)