-
Notifications
You must be signed in to change notification settings - Fork 229
Open
Description
Is this consider an acceptable change?
diff --git a/labgrid/driver/commandmixin.py b/labgrid/driver/commandmixin.py
index 4c187681..ccad82f3 100644
--- a/labgrid/driver/commandmixin.py
+++ b/labgrid/driver/commandmixin.py
@@ -1,3 +1,5 @@
+import re
+
from time import sleep
from ..util import Timeout
@@ -23,12 +25,12 @@ class CommandMixin:
Args:
cmd (str): command to run on the shell
- pattern (str): pattern as a string to look for in the output
+ pattern (str): regex pattern string to look for in the output
timeout (float): timeout for the pattern detection
sleepduration (int): sleep time between the runs of the cmd
"""
timeout = Timeout(timeout)
- while not any(pattern in s for s in self.run_check(cmd)) and not timeout.expired:
+ while not any(re.search(pattern, s) for s in self.run_check(cmd)) and not timeout.expired:
sleep(sleepduration)
if timeout.expired:
raise ExecutionError("Wait timeout expired")
Metadata
Metadata
Assignees
Labels
No labels