spdkcli: handle BrokenPipeError

Catch BrokenPipeError to display meaningful error message.

Withouth this change, user gets stacktrace
  when e.g. SPDK application was closed.

Change-Id: Ia7d8edb92a70b4c4b9e71a7d4ce38e265769936a
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461571
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Vitaliy Mysak 2019-07-12 18:25:21 +00:00 committed by Darek Stojaczyk
parent 9375616ae2
commit 9fd7f2196b

View File

@ -74,6 +74,9 @@ def main():
spdk_shell.run_interactive()
except (JSONRPCException, ExecutionError) as e:
spdk_shell.log.error("%s" % e)
except BrokenPipeError as e:
spdk_shell.log.error("Lost connection with SPDK: %s" % e)
break
if __name__ == "__main__":