...so that it can be used outside the filter test as well.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
import qa_job_utils
import qa_utils
-from qa_utils import AssertCommand, AssertEqual, AssertIn
-
-
-def stdout_of(cmd):
- """Small helper to run a stdout_of.
- Makes sure the stdout_of returns exit code 0.
-
- @type cmd: list of strings
- @param cmd: the stdout_of to run
-
- @return: Captured, stripped stdout.
- """
- _, out, _ = AssertCommand(cmd)
- return out.strip()
+from qa_utils import AssertCommand, AssertEqual, AssertIn, stdout_of
def GetJobStatus(job_id):
import qa_logging
import qa_error
-from qa_utils import AssertCommand, GetCommandOutput, GetObjectInfo
+from qa_utils import AssertCommand, GetCommandOutput, GetObjectInfo, stdout_of
AVAILABLE_LOCKS = [locking.LEVEL_NODE, ]
return rcode, stdout, stderr
+def stdout_of(cmd):
+ """Small helper to run a stdout_of.
+ Makes sure the stdout_of returns exit code 0.
+
+ @type cmd: list of strings
+ @param cmd: the stdout_of to run
+
+ @return: Captured, stripped stdout.
+ """
+ _, out, _ = AssertCommand(cmd)
+ return out.strip()
+
+
def AssertRedirectedCommand(cmd, fail=False, node=None, log_cmd=True):
"""Executes a command with redirected output.