Fix syntax warning message:
<unknown>:68: SyntaxWarning: invalid escape sequence '\w'
teuthology/task/ssh_keys.py:57: SyntaxWarning: invalid escape sequence '\w'
match = re.match('[\w-]+ {key} \S+@\S+'.format(key=re.escape(ssh_key)), line_to_test)
teuthology/task/ssh_keys.py:68: SyntaxWarning: invalid escape sequence '\w'
match = re.match('[\w-]+ \S+ {username}@\S+'.format(username=username), line_to_test)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@clyso.com>
"""
Check the validity of the ssh_key
"""
- match = re.match('[\w-]+ {key} \S+@\S+'.format(key=re.escape(ssh_key)), line_to_test)
+ match = re.match(r'[\w-]+ {key} \S+@\S+'.format(key=re.escape(ssh_key)), line_to_test)
if match:
return False
"""
Check the validity of the username
"""
- match = re.match('[\w-]+ \S+ {username}@\S+'.format(username=username), line_to_test)
+ match = re.match(r'[\w-]+ \S+ {username}@\S+'.format(username=username), line_to_test)
if match:
return False