diff options
| author | Martin Peres <martin.peres@linux.intel.com> | 2017-04-28 17:25:02 +0300 |
|---|---|---|
| committer | Martin Peres <martin.peres@linux.intel.com> | 2017-04-28 17:28:00 +0300 |
| commit | 78485289e2ebcde7bd41fa0444c78fe39b804dbe (patch) | |
| tree | 6e6699a2072b52ace2dae4bfa0f45aec183d5d96 /python-modules | |
| parent | 098c7d86d3c5bc37fc38a45bdc8490331e50f8c2 (diff) | |
runner: catch exceptions when trying to write to runner.sh's stdin
Diffstat (limited to 'python-modules')
| -rw-r--r-- | python-modules/ezbench/runner.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python-modules/ezbench/runner.py b/python-modules/ezbench/runner.py index 1d1a311..91624ba 100644 --- a/python-modules/ezbench/runner.py +++ b/python-modules/ezbench/runner.py @@ -370,8 +370,13 @@ class Runner: # Send the wanted command timestamp = datetime.now() - self.runner.stdin.write(cmd + "\n") - self.runner.stdin.flush() + try: + self.runner.stdin.write(cmd + "\n") + self.runner.stdin.flush() + except: + err = "Could not send the command '{}'\n".format(cmd) + raise RunnerError(dict({"msg": err, "err_str": err, + "err_code":RunnerErrorCode.UNKNOWN})) # Read the output cmd_output = [] |
