diff --git a/scripts/spdkcli.py b/scripts/spdkcli.py index 743ed0607..5a668c26b 100755 --- a/scripts/spdkcli.py +++ b/scripts/spdkcli.py @@ -44,7 +44,13 @@ def main(): help="commands to execute by SPDKCli as one-line command") args = parser.parse_args() - with rpc.client.JSONRPCClient(args.socket) as client: + try: + client = rpc.client.JSONRPCClient(args.socket) + except JSONRPCException as e: + spdk_shell.log.error("%s. SPDK not running?" % e) + sys.exit(1) + + with client: root_node = UIRoot(client, spdk_shell) root_node.verbose = args.verbose try: