Spdk/scripts
Vitaliy Mysak 6ef78fe661 spdkcli: handle intialiazation error
Catch exceptions during RPC client initialization
  to display meaningful error message.

Withouth this change, user gets stacktrace
  when e.g. SPDK application is not running.

Before:
```
Traceback (most recent call last):
  File "scripts/rpc/client.py", line 53, in __init__
    raise socket.error("Unix socket '%s' does not exist" % addr)
OSError: Unix socket '/var/tmp/spdk.sock' does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scripts/spdkcli.py", line 74, in <module>
    main()
  File "scripts/spdkcli.py", line 47, in main
    with rpc.client.JSONRPCClient(args.socket) as client:
  File "scripts/rpc/client.py", line 56, in __init__
    "Error details: %s" % (addr, ex))
rpc.client.JSONRPCException: Error while connecting to /var/tmp/spdk.sock
Error details: Unix socket '/var/tmp/spdk.sock' does not exist
```

After:
```
Error while connecting to /var/tmp/spdk.sock
Error details: Unix socket '/var/tmp/spdk.sock' does not exist. SPDK not running?
```

Change-Id: I65862965b68acf3bd4709de598f04de49da27de2
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462020
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>
2019-07-22 02:24:11 +00:00
..
ceph scripts: replace backticsk with dollar-parenthesis syntax 2019-07-05 12:06:10 +00:00
perf test/vhost: Export default VM_IMAGE from common.sh 2019-07-03 04:15:18 +00:00
rpc rpc.py: check if port is None during client init 2019-07-22 02:24:11 +00:00
spdkcli spdkcli: fix pmem_pool_info command 2019-07-15 03:39:06 +00:00
vagrant scripts: replace backticsk with dollar-parenthesis syntax 2019-07-05 12:06:10 +00:00
check_format.sh scripts/check_format: fix checking patch files 2019-07-12 07:48:09 +00:00
common.sh scripts/common.sh: use PCI blacklist and whitelist 2019-02-11 13:29:38 +00:00
config_converter.py iscsi: Deprecate MinConnectionsPerCore 2019-05-06 17:10:48 +00:00
detect_cc.sh detect_cc: Handle empty arguments 2019-02-19 06:39:10 +00:00
eofnl scripts/check_format: check trailing whitespace 2017-10-24 17:35:23 -04:00
fio.py scripts/fio.py: add argparse for command line parameters 2019-06-03 04:34:10 +00:00
gdb_macros.py scripts: Use range instead of xrange 2019-02-13 22:54:15 +00:00
gen_ftl.sh bdev/ftl: Add json config generation 2019-04-01 23:59:39 +00:00
gen_nvme.sh scripts: replace backticsk with dollar-parenthesis syntax 2019-07-05 12:06:10 +00:00
gen_rbd.sh test/bdev: add Ceph RBD bdev to bdev tests 2018-02-26 11:12:35 -05:00
genconfig.py scripts:Fix Python errors in checking scripts 2019-02-12 18:37:09 +00:00
histogram.py histograms: add script for parsing histogram data 2019-01-24 14:14:32 +00:00
pkgdep.sh scripts: replace egrep with grep -E 2019-07-05 12:06:10 +00:00
posix.txt build: Automatically detect use of POSIX includes 2017-05-08 13:20:37 -07:00
prep_benchmarks.sh scripts: replace backticsk with dollar-parenthesis syntax 2019-07-05 12:06:10 +00:00
qat_setup.sh test: adjust scripts for 01.org qat driver 2018-11-15 20:08:16 +00:00
rpc_http_proxy.py scripts, test: fix python overindent issues 2019-04-04 03:59:12 +00:00
rpc.py nvmf/tcp: Add a feature to allow set the sock priority of the connection. 2019-07-19 06:30:19 +00:00
setup.sh scripts: Fix setup.sh to take into consideration other namespaces 2019-07-18 03:18:13 +00:00
spdkcli.py spdkcli: handle intialiazation error 2019-07-22 02:24:11 +00:00