[3/7] framework/ssh_pexpect: Remove duplicate regex flags
Commit Message
The regex pattern "(?i)" sets global re.I flag. Not only the duplicate
regex flags are redundant, but the flags not placed at the start of the
regex makes it incompatible with Python 3.11, according to:
https://docs.python.org/3.11/library/re.html#regular-expression-syntax
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
framework/ssh_pexpect.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -50,7 +50,7 @@ class SSHPexpect:
original_prompt="[$#>]",
port=self.port,
login_timeout=20,
- password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(?i)(password for .+:)",
+ password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(password for .+:)",
)
except Exception as e:
print(e)
@@ -68,7 +68,7 @@ class SSHPexpect:
self.username,
self.password,
original_prompt="[$#>]",
- password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(?i)(password for .+:)",
+ password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(password for .+:)",
)
self.send_expect("stty -echo", "#")
self.send_expect("stty columns 1000", "#")