Revision e6ce18ac qa/qa_utils.py
b/qa/qa_utils.py | ||
---|---|---|
24 | 24 |
""" |
25 | 25 |
|
26 | 26 |
import os |
27 |
import re |
|
27 | 28 |
import sys |
28 | 29 |
import subprocess |
29 | 30 |
|
... | ... | |
92 | 93 |
raise qa_error.Error('%r != %r' % (first, second)) |
93 | 94 |
|
94 | 95 |
|
96 |
def AssertMatch(string, pattern): |
|
97 |
"""Raises an error when string doesn't match regexp pattern. |
|
98 |
|
|
99 |
""" |
|
100 |
if not re.match(pattern, string): |
|
101 |
raise qa_error.Error("%r doesn't match /%r/" % (string, pattern)) |
|
102 |
|
|
103 |
|
|
95 | 104 |
def GetSSHCommand(node, cmd, strict=True): |
96 | 105 |
"""Builds SSH command to be executed. |
97 | 106 |
|
Also available in: Unified diff