scripts/rpc.py: fix pipe for whitespace separated list arguments

Ordinary python str.split() will by default split on each whitespace.
This includes arguments for rpc.py which expect a whitespace separated list,
eg. construct_raid_bdev -b "Bdev_1 Bdev_2".
shlex.split() prevents splitting on quoted arguments.

Change-Id: If37eb87cf82a161263f2b247baff5c8a77c43efc
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453652
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Karol Latecki 2019-05-08 12:01:16 +02:00 committed by Darek Stojaczyk
parent 211cb4c250
commit 22c3befd3d

View File

@ -6,6 +6,7 @@ import logging
import argparse
import rpc
import sys
import shlex
try:
from shlex import quote
@ -1802,7 +1803,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
def execute_script(parser, client, fd):
for rpc_call in map(str.rstrip, fd):
args = parser.parse_args(rpc_call.split())
args = parser.parse_args(shlex.split(rpc_call))
args.client = client
call_rpc_func(args)