From 8c883b977f0ba86fde42defecb98683180e0ce3e Mon Sep 17 00:00:00 2001 From: yidong0635 Date: Mon, 15 Jun 2020 06:11:51 -0400 Subject: [PATCH] scripts/spdkcli: Stay on command input. It will except in the middle of creation if an error command inputted. usrs hope it could stay on consle. So change this. For example: ''' SPDK CLI v0.1 /> lsss Command not found lsss /> ''' Signed-off-by: yidong0635 Change-Id: Ib8d38b5d3f6db1bae965c56e3b78ff715a574189 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2886 Community-CI: Mellanox Build Bot Reviewed-by: Karol Latecki Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins --- scripts/spdkcli.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/spdkcli.py b/scripts/spdkcli.py index bc85649e0d..3d7c63baa8 100755 --- a/scripts/spdkcli.py +++ b/scripts/spdkcli.py @@ -71,12 +71,13 @@ def main(): spdk_shell.con.display("SPDK CLI v0.1") spdk_shell.con.display("") - try: - 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) + while not spdk_shell._exit: + try: + 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) if __name__ == "__main__":